[Interest] Bad application rendering on Remote Desktop

Agocs Laszlo laszlo.agocs at theqtcompany.com
Wed Apr 29 11:31:46 CEST 2015


Hi Calogero,

When adding a QOpenGLWidget or QQuickWidget into a widget hierarchy in a
window, the entire window will be rendered differently: it is switched
over to OpenGL-based compositing. This involves using OpenGL features not
present in OpenGL 1.1.

If you avoid adding (parenting) the QOpenGLWidget into the window, you
will find that it becomes functional with GL 1.1 again. This is because
you then use the traditional path without relying on GL.

Note also that switching back and forth between the rendering models is
not fully in place: making a QOpenGLWidget invisible or even removing it
may not have any effect on how the window is rendered afterwards.

Best regards,
Laszlo

On 29/04/15 10:26, "Calogero Mauceri" <mauceri at actgate.com> wrote:

>Thanks Laszlo for your explanation.
>
>I still do not understand why the whole application is not properly
>rendered, not only the OpenGL stuff.
>The application we are developing is a quite complex one, having
>multiple windows, and the OpenGL one is a small part of it.
>Simply including just one instance of QOpenGLWidget in the application
>causes the bad rendering, even if that widget is not even shown.
>
>Calogero
>
>Il 4/28/2015 8:54 PM, Agocs Laszlo ha scritto:
>> Because when using remote desktop you are suddenly left with OpenGL 1.1
>> (ouch) and so QOpenGLWidget and friends that rely on OpenGL 2.0 features
>> (like framebuffer objects) cease to function.
>>
>> The solution is to rely on ANGLE or a software rasterizer (like Mesa
>> llvmpipe) in this case.
>>
>> When using the dynamic OpenGL builds, the fallback to ANGLE will happen
>> automatically when using remote desktop. I assume you are using the
>> -opengl packages from 5.4.1 and that's why this is not in place. With
>>5.5
>> this won't be an issue since desktop OpenGL packages will not be
>>provided
>> anymore.
>>
>> Best regards,
>> Laszlo
>>
>>
>> On 27/04/15 17:17, "Calogero Mauceri" <mauceri at actgate.com> wrote:
>>
>>> Hi all,
>>>
>>> switching my application from using QGLWidget to the new QOpenGLWidget
>>>I
>>> noticed a very weird problem when using the application through Remote
>>> Desktop on Windows. The whole application is fully black, it is not
>>> properly rendered, not only the QOpenGLWidget, but also the other
>>> widgets in the application.
>>>
>>> I created a very simple example demonstrating my issue.
>>>
>>> MyWidget::MyWidget(QWidget* parent, Qt::WindowFlags fl)
>>>      : QWidget(parent, fl)
>>> {
>>>      QVBoxLayout *vBoxLayout = new QVBoxLayout(this);
>>>      QHBoxLayout *hLayout = new QHBoxLayout;
>>>
>>>      QLabel *myLabel = new QLabel("Test", this);
>>>      QPushButton *myButton = new QPushButton("Test", this);
>>>      hLayout->addWidget(myLabel);
>>>      hLayout->addWidget(myButton);
>>>
>>>      QGLWidget *myOPenGLWidget = new QGLWidget(this);
>>>      // QOpenGLWidget *myOPenGLWidget = new QOpenGLWidget(this);// this
>>> causes bad app rendering on Remote Desktop
>>>
>>>      vBoxLayout->addItem(hLayout);
>>>      vBoxLayout->addWidget(myOPenGLWidget);
>>> }
>>>
>>> When I use QGLWidget the widgets are properly rendered, as you can see
>>> in the attached image. When I replace the QGLWidget with its counter
>>> part QOpenGLWidget then the whole app is fully black when launched
>>> through remote desktop (on Windows), no widget is rendered (see other
>>> image attached). If I run the application on my local machine, then
>>> everything is properly rendered.
>>>
>>> Am I doing something wrong? Or is this a limit/bug in Qt (I'm using
>>> latest Qt version, 5.4.1)?
>>>
>>> This is my main
>>>
>>> int main( int argc, char *argv[] )
>>> {
>>>      QApplication appMain(argc, argv);
>>>
>>>      MyWidget *mainWin = new MyWidget;
>>>      mainWin->show();
>>>
>>>      return appMain.exec();
>>> }
>>>
>>> I enabled qt.qpa.gl debugging and this is the output of the application
>>> in the two cases.
>>>
>>> Output in case of QGLWidget enabled:
>>> [...]
>>> qt.qpa.gl: QWindowsIntegration::createPlatformOpenGLContext
>>> QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 1,
>>> redBufferSize -1, greenBufferSize -1, blueBufferSize -1,
>>>alphaBufferSize
>>> -1, stencilBufferSize 1, samples -1, swapBehavior 2, swapInterval -1,
>>> profile  0)
>>> qt.qpa.gl: Qt: Using WGL and OpenGL from "opengl32.dll"
>>> qt.qpa.gl: QOpenGLStaticContext::create OpenGL: "Microsoft
>>> Corporation","GDI Generic" default ContextFormat: v1.1 profile: 0
>>> options: QFlags(0x4)
>>> Extensions: 3
>>> qt.qpa.gl: QWindowsGLContext::QWindowsGLContext 0x6be850 GDI
>>> requested:  QSurfaceFormat(version 2.0, options QFlags(),
>>> depthBufferSize 1, redBufferSize -1, greenBufferSize -1, blueBufferSize
>>> -1, alphaBufferSize -1, stencilBufferSize 1, samples -1, swapBehavior
>>>2,
>>> swapInterval -1, profile  0)
>>>      obtained # 8 GDI QSurfaceFormat(version 1.1, options QFlags(0x4),
>>> depthBufferSize 16, redBufferSize 8, greenBufferSize 8, blueBufferSize
>>> 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior 2,
>>> swapInterval 1, profile  0)
>>>       PIXELFORMATDESCRIPTOR dwFlags=0x465 PFD_DRAW_TO_WINDOW
>>> PFD_SUPPORT_OPENGL PFD_GENERIC_FORMAT PFD_DOUBLEBUFFER iPixelType=0
>>> cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8
>>> cBlueBits=8 cBlueShift=0 cDepthBits=16 cStencilBits=8 iLayerType=0
>>> cAlphaBits=8 cAlphaShift=0 cAccumBits=64 cAccumRedBits=16
>>> cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 swap interval:
>>>-1
>>>      default: ContextFormat: v1.1 profile: 0 options: QFlags(0x4)
>>>      HGLRC=0x20000
>>> [...]
>>>
>>> Output in case of QOpenGLWidget enabled:
>>> [...]
>>> qt.qpa.gl: QWindowsIntegration::createPlatformOpenGLContext
>>> QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize -1,
>>> redBufferSize -1, greenBufferSize -1, blueBufferSize -1,
>>>alphaBufferSize
>>> -1, stencilBufferSize -1, samples -1, swapBehavior 0, swapInterval 1,
>>> profile  0)
>>> qt.qpa.gl: Qt: Using WGL and OpenGL from "opengl32.dll"
>>> qt.qpa.gl: QOpenGLStaticContext::create OpenGL: "Microsoft
>>> Corporation","GDI Generic" default ContextFormat: v1.1 profile: 0
>>> options: QFlags(0x4)
>>> Extensions: 3
>>> qt.qpa.gl: QWindowsGLContext::QWindowsGLContext 0x4c0e68 GDI
>>> requested:  QSurfaceFormat(version 2.0, options QFlags(),
>>> depthBufferSize -1, redBufferSize -1, greenBufferSize -1,
>>>blueBufferSize
>>> -1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior
>>> 0, swapInterval 1, profile  0)
>>>      obtained # 7 GDI QSurfaceFormat(version 1.1, options QFlags(0x4),
>>> depthBufferSize 32, redBufferSize 8, greenBufferSize 8, blueBufferSize
>>> 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior 2,
>>> swapInterval 1, profile  0)
>>>       PIXELFORMATDESCRIPTOR dwFlags=0x465 PFD_DRAW_TO_WINDOW
>>> PFD_SUPPORT_OPENGL PFD_GENERIC_FORMAT PFD_DOUBLEBUFFER iPixelType=0
>>> cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8
>>> cBlueBits=8 cBlueShift=0 cDepthBits=32 cStencilBits=8 iLayerType=0
>>> cAlphaBits=8 cAlphaShift=0 cAccumBits=64 cAccumRedBits=16
>>> cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 swap interval:
>>>-1
>>>      default: ContextFormat: v1.1 profile: 0 options: QFlags(0x4)
>>>      HGLRC=0x20000
>>> QOpenGLShaderProgram: could not create shader program
>>> QOpenGLShader: could not create shader
>>> bool __thiscall QOpenGLTextureBlitter::create(void) Could not link
>>> shader program:
>>>   ""
>>> QOpenGLBuffer::bind(): buffer not created
>>> QOpenGLBuffer::release(): buffer not created
>>> QOpenGLBuffer::bind(): buffer not created
>>> QOpenGLBuffer::release(): buffer not created
>>> [...]
>>>
>>> Thanks in advance for your help!
>>> Calogero
>>>
>>> -- 
>>> Calogero Mauceri
>>> Software Engineer
>>>
>>> Applied Coherent Technology Corporation (ACT)
>>> www.actgate.com
>>>
>
>-- 
>Calogero Mauceri
>Software Engineer
>
>Applied Coherent Technology Corporation (ACT)
>www.actgate.com
>
>
>_______________________________________________
>Interest mailing list
>Interest at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list