aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/get.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/get.c')
-rw-r--r--mesalib/src/mesa/main/get.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index 8dc47306f..67732521c 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -289,6 +289,12 @@ static const int extra_ARB_sampler_objects[] = {
EXTRA_END
};
+static const int extra_ARB_uniform_buffer_object_and_geometry_shader[] = {
+ EXT(ARB_uniform_buffer_object),
+ EXT(ARB_geometry_shader4),
+ EXTRA_END
+};
+
EXTRA_EXT(ARB_ES2_compatibility);
EXTRA_EXT(ARB_texture_cube_map);
@@ -335,6 +341,7 @@ EXTRA_EXT(EXT_framebuffer_sRGB);
EXTRA_EXT(ARB_texture_buffer_object);
EXTRA_EXT(OES_EGL_image_external);
EXTRA_EXT(ARB_blend_func_extended);
+EXTRA_EXT(ARB_uniform_buffer_object);
static const int
extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
@@ -1321,6 +1328,31 @@ static const struct value_desc values[] = {
{ GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended },
+ /* GL_ARB_uniform_buffer_object */
+ { GL_MAX_VERTEX_UNIFORM_BLOCKS, CONTEXT_INT(Const.VertexProgram.MaxUniformBlocks),
+ extra_ARB_uniform_buffer_object },
+ { GL_MAX_FRAGMENT_UNIFORM_BLOCKS, CONTEXT_INT(Const.FragmentProgram.MaxUniformBlocks),
+ extra_ARB_uniform_buffer_object },
+ { GL_MAX_GEOMETRY_UNIFORM_BLOCKS, CONTEXT_INT(Const.GeometryProgram.MaxUniformBlocks),
+ extra_ARB_uniform_buffer_object_and_geometry_shader },
+ { GL_MAX_COMBINED_UNIFORM_BLOCKS, CONTEXT_INT(Const.MaxCombinedUniformBlocks),
+ extra_ARB_uniform_buffer_object },
+ { GL_MAX_UNIFORM_BLOCK_SIZE, CONTEXT_INT(Const.MaxUniformBlockSize),
+ extra_ARB_uniform_buffer_object },
+ { GL_MAX_UNIFORM_BUFFER_BINDINGS, CONTEXT_INT(Const.MaxUniformBufferBindings),
+ extra_ARB_uniform_buffer_object },
+
+ { GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, CONTEXT_INT(Const.VertexProgram.MaxCombinedUniformComponents),
+ extra_ARB_uniform_buffer_object },
+ { GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, CONTEXT_INT(Const.FragmentProgram.MaxCombinedUniformComponents),
+ extra_ARB_uniform_buffer_object },
+ { GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS, CONTEXT_INT(Const.GeometryProgram.MaxCombinedUniformComponents),
+ extra_ARB_uniform_buffer_object_and_geometry_shader },
+ { GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, CONTEXT_INT(Const.UniformBufferOffsetAlignment),
+ extra_ARB_uniform_buffer_object },
+
+ { GL_UNIFORM_BUFFER_BINDING, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_uniform_buffer_object },
+
#endif /* FEATURE_GL */
};
@@ -1771,6 +1803,10 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
v->value_int = samp ? samp->Name : 0;
}
break;
+ /* GL_ARB_uniform_buffer_object */
+ case GL_UNIFORM_BUFFER_BINDING:
+ v->value_int = ctx->UniformBuffer->Name;
+ break;
}
}
@@ -2530,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: