[Development] OpenGL Issues in Qt5.7

Sean Harmer sean.harmer at kdab.com
Wed Oct 26 09:54:36 CEST 2016


Hi,

On 26/10/2016 08:21, Kai Koehne wrote:
>> -----Original Message-----
>> From: Liu, Jeff (SRDC SW) [mailto:Jeff1.Liu at amd.com]
>> Sent: Wednesday, October 26, 2016 7:09 AM
>> To: gunnar.sletta at jollamobile.com; gunnar at sletta.org; Liang Qi
>> <Liang.Qi at qt.io>; Kai Koehne <Kai.Koehne at qt.io>; development at qt-
>> project.org
>> Subject: RE: OpenGL Issues in Qt5.7
>>
>>
>>
>> Spread to Qt mail-list to ask for help.
>>
>>
>>
>> From: Liu, Jeff (SRDC SW)
>> Sent: Tuesday, October 25, 2016 2:26 PM
>> To: 'gunnar.sletta at jollamobile.com'; 'gunnar at sletta.org'; 'liang.qi at qt.io';
>> 'kai.koehne at qt.io'
>> Subject: OpenGL Issues in Qt5.7
>>
>>
>>
>> Hi Sletta, Qi and Koehne,
> Hi Jeff!
>
>> This is Jeff from AMD, recently a customer reports a game issue with AMD
>> cards, but the game runs well on Nvidia card, after some debug, I find out
>> that the issues are caused by Qt libraries, when Qt programs with OpenGL
>> API, it doesn’t follow the OpenGL programming specification strictly, so it will
>> report errors on AMD platform.
>>
>> Now we find out the two following issues, both issues come from Qt paint
>> engine.
>>
>> 1.       QTBUG-56234 - OpenGL glVertexAttribArray API usage error in
>> Qt5Guid.dll
>>
>> I submit a ticket to address this issue, and this issue is assigned to Sletta, but
>> it seems no one starts to work on it, the usage of glVertexAttribArray API is
>> wrong, it is still used in the old way (OpenGL 3.0), but it apparently violate the
>> latest OpenGL specification (OpenGL 4.1)
> Liang already commented on this one. Laszlo (the new assignee) probably
> has a better idea about this, too.

As commented on the bug, this QOpenGL2PaintEngine is only meant for use 
with a 2.x OpenGL context. The paint engine will not work properly with 
a Core Profile context. All the shaders are also legacy (attribute + 
varying vs in + out).

>
>> 2.       I don’t submit the ticket for the second issue yet,  Qt paint engine uses
>> GL_RED to upload the texture, so based on the spec, the texture will be
>> (GL_RED value, 0,0,1), but in pixel shader, it uses src * mask.a, which is a
>> constant 0 value in AMD platform, if changed to src * mask.r, then everything
>> will be correct, I will submit a ticket to address it later.
> Feel free to report this, too.

Again, this would really require a new OpenGL paint engine for modern 
OpenGL to be written. Afaik nobody is working on this or even looking 
into it. Using Qt Quick 2 would be an easier path if it suits your use 
case. I'd love to have the ability to composite widget painting with 
modern GL so if you want to work on such a thing then please do feel 
free to do so.

Cheers,

Sean





More information about the Development mailing list