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 4 of 4

Thread: Shader buffer storage: second set of uniform cause INVALID_OPERATION

  1. #1
    Intern Contributor
    Join Date
    Nov 2009
    Location
    Ukraine
    Posts
    80

    Shader buffer storage: second set of uniform cause INVALID_OPERATION

    Hi.
    Here is shader code

    Code :
    layout(std430, binding = 4) buffer MVMatrix 
    { 
     mat4 ModelView[];
    } mvMat;
     
    uniform int ObjectIndex;
    ...
    vec4 pos = mvMat.ModelView[ObjectIndex] * vec4(in_Position, 1.0);

    To mvMat binded range of buffer with type GL_SHADER_STORAGE_BUFFER. Buffer size is 65556 (1024 matrices)

    First set of ObjectIndex to any value is OK
    Second set of ObjectIndex to any value get GL_INVALID_OPERATION error generated. Wrong component type or count.

    This message I get from DebugCallback, when execution point return from callback to place after glUniformi1


    Also glGetProgramResourceiv for GL_TOP_LEVEL_ARRAY_SIZE return zero.

    Graphic driver is GeForce 314.21 beta

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Well, it's all kind of hard to tell without seeing the actual code where you're getting these errors. Also, I don't see what this has to do with a storage buffer; how uniforms works is an entirely orthogonal issue.

  3. #3
    Intern Contributor
    Join Date
    Nov 2009
    Location
    Ukraine
    Posts
    80
    Quote Originally Posted by Alfonse Reinheart View Post
    Well, it's all kind of hard to tell without seeing the actual code where you're getting these errors.
    I agree, but it is hard to cut code from framework and make it clear to all. My hope is that someone faced a similar problem.
    Quote Originally Posted by Alfonse Reinheart View Post
    I don't see what this has to do with a storage buffer; how uniforms works is an entirely orthogonal issue.
    I think most likely problem in driver - it can't properly setup index for array through uniform or can't properly calculate array length from buffer size.

    I will try to make a simple demo with raw GL for better understanding.

  4. #4
    Intern Contributor
    Join Date
    Nov 2009
    Location
    Ukraine
    Posts
    80
    gDebugger help me.
    Error was trivial - second setting of uniform was happens for other shader program where not that uniform.
    So there is no driver bug, only curved hands

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
  •