Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Possible driver bug?

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2016
    Posts
    6

    Possible driver bug?

    Hey,

    I've been searching a lot on this topic, though I cannot seem to find anyone having the same problem as me.
    Consider a shader SSBO like:
    Code :
    #version 430
     
    layout (std430) buffer myBlock
    {
        vec4 color;
        vec3 direction;
        ...
    };
     
    void main()
    {
    ...
    }

    Than you should be able to querry the index of that Buffer object with:
    Code :
    int blockIndex = GL43.glGetProgramResourceIndex(programID, GL43.GL_SHADER_STORAGE_BLOCK, "myBlock");
    Unfortunatly it always returns '-1' (e.g. INVALID_INDEX).
    I tried replacing the SSBO with an UBO (and use GL43.GL_UNIFORM_BLOCK as GLEnum in the 'glGetProgramResourceIndex' method) and it works as expected.

    So further testing was querying the name with:
    Code :
    String blockName = GL43.glGetProgramResourceName(program, GL43.GL_SHADER_STORAGE_BLOCK, 0, 20);
    And it returns "myBlock"(with delimiter) as expected.
    I used index '0' because its the only SSBO declared in the whole ShaderProgram.

    So even if I do:
    Code :
    int blockIndex = GL43.glGetProgramResourceIndex(programID, GL43.GL_SHADER_STORAGE_BLOCK, GL43.glGetProgramResourceName(program, GL43.GL_SHADER_STORAGE_BLOCK, 0, 20));
    It will still return '-1' (e.g. INVALID_INDEX).

    So my question is; am I doing anything wrong, or is this possibly a bug from my driver.
    I wouldnt be suprissed if it is tbh. since I have many problems with different render engines as well.

    Any help/comment is appreciated!

  2. #2
    Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    369
    Are you using members of myBlock in your shader? If none of its values are used, or at least used to produce a value output to the next stage (or framebuffer), the GLSL compiler will optimize it out entirely.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •