mesa: Add support for glGetIntegeri_v from GL_ARB_uniform_buffer_object.
authorEric Anholt <eric@anholt.net>
Mon, 18 Jun 2012 22:59:13 +0000 (15:59 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 21 Jun 2012 17:58:10 +0000 (10:58 -0700)
Fixes piglit ARB_uniform_buffer_object/getintegeri_v.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/get.c

index 9e9ddcbcc4339f60278f075a47d461ad5b15334b..67732521c53ad91fe79efe4cedd1e2f9ebeff5a2 100644 (file)
@@ -2566,6 +2566,30 @@ find_value_indexed(const char *func, GLenum pname, int index, union value *v)
         goto invalid_enum;
       v->value_int = ctx->TransformFeedback.CurrentObject->BufferNames[index];
       return TYPE_INT;
+
+   case GL_UNIFORM_BUFFER_BINDING:
+      if (index >= ctx->Const.MaxUniformBufferBindings)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_uniform_buffer_object)
+        goto invalid_enum;
+      v->value_int = ctx->UniformBufferBindings[index].BufferObject->Name;
+      return TYPE_INT;
+
+   case GL_UNIFORM_BUFFER_START:
+      if (index >= ctx->Const.MaxUniformBufferBindings)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_uniform_buffer_object)
+        goto invalid_enum;
+      v->value_int = ctx->UniformBufferBindings[index].Offset;
+      return TYPE_INT;
+
+   case GL_UNIFORM_BUFFER_SIZE:
+      if (index >= ctx->Const.MaxUniformBufferBindings)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_uniform_buffer_object)
+        goto invalid_enum;
+      v->value_int = ctx->UniformBufferBindings[index].Size;
+      return TYPE_INT;
    }
 
  invalid_enum: