Mesa (master): main: fix ACTIVE_UNIFORM_BLOCKS value
Samuel Iglesias Gonsálvez
samuelig at kemper.freedesktop.org
Tue Sep 29 08:05:23 UTC 2015
Module: Mesa
Branch: master
Commit: 38004eb17ce9663a4343bae4e783e97e73596e9c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=38004eb17ce9663a4343bae4e783e97e73596e9c
Author: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
Date: Fri Sep 11 10:02:56 2015 +0200
main: fix ACTIVE_UNIFORM_BLOCKS value
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 at igalia.com>
Reviewed-by: Timothy Arceri <t_arceri at yahoo.com.au>
---
src/mesa/main/shaderapi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index edc23bc..00c51e2 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -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
More information about the mesa-commit
mailing list