From d103fead197c684c8396183d81bb846213afe81a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 18 Jun 2012 15:59:13 -0700 Subject: [PATCH] mesa: Add support for glGetIntegeri_v from GL_ARB_uniform_buffer_object. Fixes piglit ARB_uniform_buffer_object/getintegeri_v. Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke --- src/mesa/main/get.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 9e9ddcbcc43..67732521c53 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -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: -- 2.30.2