aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/shaderapi.c')
-rw-r--r--mesalib/src/mesa/main/shaderapi.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index 7c97a6359..caeb9657e 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -544,6 +544,35 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
*params = shProg->Geom.OutputType;
break;
#endif
+ case GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: {
+ unsigned i;
+ GLint max_len = 0;
+
+ if (!ctx->Extensions.ARB_uniform_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
+ return;
+ }
+
+ for (i = 0; i < shProg->NumUniformBlocks; i++) {
+ /* Add one for the terminating NUL character.
+ */
+ const GLint len = strlen(shProg->UniformBlocks[i].Name) + 1;
+
+ if (len > max_len)
+ max_len = len;
+ }
+
+ *params = max_len;
+ break;
+ }
+ case GL_ACTIVE_UNIFORM_BLOCKS:
+ if (!ctx->Extensions.ARB_uniform_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
+ return;
+ }
+
+ *params = shProg->NumUniformBlocks;
+ break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
return;