1 Reply Latest reply on Nov 18, 2015 2:47 AM by pinform

    GLSL issue when using #version 440 or newer

    acslo

      Running Catalyst 15.10 beta, Windows 8.1 x64, on Radeon 6870

       

      I'm seeing issues when using #version 440 or later in any GLSL shader. First issue I'm seeing is the same as the one here:GLSL "#version 440" breaks std140 layout [Catalyst 15.7.1]

       

      As an example, I have the following uniform block in the vertex and fragment shaders (which are using #version 450 core) of a linked program.

       

      layout(std140, binding = 0) uniform Lights

      {

        mat4 u_LightViewProjectionMatrix;

        vec4 u_LightPosition;

        vec4 u_LightColor;

      };

       

      When performing introspection on the program through GL, I'm seeing these offsets:

       

        mat4 u_LightViewProjectionMatrix (+0 bytes)

        vec4 u_LightPosition (+3131 bytes)

        vec4 u_LightColor (+6262 bytes)

       

      Changes to the shader seem to change the seemingly random offsets of all but the first uniform.

       

      The other issue I've noticed is sometimes the GL driver will TDR (application freezes for a second or two, and the driver gets reset by Windows) when a compute shader contains a dynamic index into shared memory.

       

      Both these issues go away when using #version 430 in the shaders.

       

       

      Alex