main: fix ACTIVE_UNIFORM_BLOCKS value
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Fri, 11 Sep 2015 08:02:56 +0000 (10:02 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 29 Sep 2015 08:03:47 +0000 (10:03 +0200)
NumUniformBlocks also counts shader storage blocks.
NumUniformBlocks variable will be renamed in a later patch to avoid
misunderstandings.

v2:

- Modify the condition to use !IsShaderStorage and the list of
  uniform blocks (Timothy)

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
src/mesa/main/shaderapi.c

index edc23bcefe3daf33aa6e154d2771d51328431c6b..00c51e2bd3d7ba0b7d4f1d90cecfd7d999108c3e 100644 (file)
@@ -729,7 +729,11 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
       if (!has_ubo)
          break;
 
-      *params = shProg->NumUniformBlocks;
+      *params = 0;
+      for (unsigned i = 0; i < shProg->NumUniformBlocks; i++) {
+         if (!shProg->UniformBlocks[i].IsShaderStorage)
+            (*params)++;
+      }
       return;
    case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
       /* This enum isn't part of the OES extension for OpenGL ES 2.0.  It is