[Interest] When running our Qt 6 application on a AMD RX 7600 shaders file to load

Nuno Santos nuno.santos at imaginando.pt
Mon Jul 1 10:39:50 CEST 2024


Hi,

For those of you who eventually stumble on this same issue I want to share what I have discovered. In summary I was having the error:

>> failed to link shader program: error: fail to build reflection info

After many days trying to find the solution for this problem I have found that the uniforms structure of the vertex shader and the fragment shader must match, otherwise, in this particular graphics card or family of graphics cards, this error would be displayed and the shaders wouldn’t be loaded. This was not a problem with Apple Silicon, NVIDIA or Intel Graphics. Only with AMD so far.

I still don’t know if this is a bug or an undocumented particularity but it is shady as hell.

I hope this helps people who stumble on the same problem and raises the necessary attention in case it is a bug or if it just needs additional documentation.

https://bugreports.qt.io/browse/QTBUG-126734

Thank you!

Best regards,

Nuno

> On 27 Jun 2024, at 15:20, Nuno Santos <nuno.santos at imaginando.pt> wrote:
> 
> Hi,
> 
> After spending the two last days trying to understand the cause of this problem this is what I have found and it is still very puzzling.
> 
> - The example Scene Graph - Graph works when compiled with my custom compiled from the source Qt 6.6.3 kit on the RX 7600
> - If I use exactly the same vert and frag shaders from the Scene Graph - Graph example on my application, I no longer have the error:
> 
>> failed to link shader program: error: fail to build reflection info
> 
> - If I add or remove a single field from the uniforms structure, the error returns.
> 
> If in the Scene Graph - Graph example I add the field resolution to the noisy.frag uniforms and compile it again, just like this:
> 
> layout(std140, binding = 0) uniform buf {
>  mat4 qt_Matrix;
>  vec4 color;
>  vec2 textureSize;
>  float qt_Opacity;
>  vec2 resolution; // added field
> };
> 
> The noisy node fails to pain with the same error:
> 
>> failed to link shader program: error: fail to build reflection info
> 
> 
> So the cause of problem is the customisation of the uniforms structure. Once again, this only happens on the RX 7600. It is working perfectly for Apple Silicon, Intel Graphics, NVIDIA. 
> 
> So, now my questions are:
> 
> - Is there anything else that is not stated in the documentation that serves as validation for the uniforms structure that? 
> - Is there anything particular to AMD graphics cards that could possibly causing this problem?
> 
> 
> I’m not completely in the dark now but I still don’t have a clue of what is going on.
> 
> Maybe its time to fill a bug report now?
> 
> Please advise.
> 
> Thank you!
> 
> Best regards,
> 
> Nuno
> 
>> On 25 Jun 2024, at 15:19, Nuno Santos <nuno.santos at imaginando.pt> wrote:
>> 
>> Hi,
>> 
>> I’m having an issue. I’m pretty sure this will be a basic one. 
>> 
>> I’m rewriting VS - Visual Synthesizer to Qt 6. VS consists in a set of frag shaders that are layered to compose a visual scene that reacts to music
>> 
>> There is a factory bank with several of this shaders. With Qt 6 we are still using OpenGL for previous compatibility but the shaders are being compiled to qsb.
>> 
>> It is working on Apple Silicon, Windows PC with Intel Card, NVIDIA card but with an AMD card it is saying:
>> 
>> failed to build graphics pipeline state
>> failed to link shader program: error: fail to build reflection info
>> 
>> Am I missing something? Maybe during the shader compilation to qsb?
>> 
>> Thank you!
>> 
>> Best regards,
>> 
>> Nuno Santos
>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240701/0826dd9b/attachment.htm>


More information about the Interest mailing list