summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-04-05 19:02:07 -0600
committerBrian Paul <[email protected]>2011-04-05 19:02:09 -0600
commit874a2c0b7da62f4dd08dedcec221f55b22e40e95 (patch)
treeea9f5132853bac739c6808efa99e799cbcb31dbf /src/mesa/main/get.c
parent9a77e285e8d015328278fcd0a110e662dba2e744 (diff)
mesa: core support for GL_ARB_texture_buffer_object
No GLSL or driver support yet.
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 9090ca661e3..6ef8c8792e6 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -323,6 +323,7 @@ EXTRA_EXT(ARB_vertex_buffer_object);
EXTRA_EXT(ARB_geometry_shader4);
EXTRA_EXT(ARB_copy_buffer);
EXTRA_EXT(EXT_framebuffer_sRGB);
+EXTRA_EXT(ARB_texture_buffer_object);
static const int
extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
@@ -1236,6 +1237,18 @@ static const struct value_desc values[] = {
CONTEXT_INT(Const.MaxProgramTexelOffset),
extra_EXT_gpu_shader4 },
+ /* GL_ARB_texture_buffer_object */
+ { GL_MAX_TEXTURE_BUFFER_SIZE_ARB, CONTEXT_INT(Const.MaxTextureBufferSize),
+ extra_ARB_texture_buffer_object },
+ { GL_TEXTURE_BINDING_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_texture_buffer_object },
+ { GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ TEXTURE_BUFFER_INDEX, extra_ARB_texture_buffer_object },
+ { GL_TEXTURE_BUFFER_FORMAT_ARB, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_texture_buffer_object },
+ { GL_TEXTURE_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_texture_buffer_object },
+
/* GL 3.0 */
{ GL_NUM_EXTENSIONS, LOC_CUSTOM, TYPE_INT, 0, extra_version_30 },
{ GL_MAJOR_VERSION, CONTEXT_INT(VersionMajor), extra_version_30 },
@@ -1673,6 +1686,29 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4;
break;
+
+ /* GL_ARB_texture_buffer_object */
+ case GL_TEXTURE_BUFFER_ARB:
+ v->value_int = ctx->Texture.BufferObject->Name;
+ break;
+ case GL_TEXTURE_BINDING_BUFFER_ARB:
+ unit = ctx->Texture.CurrentUnit;
+ v->value_int =
+ ctx->Texture.Unit[unit].CurrentTex[TEXTURE_BUFFER_INDEX]->Name;
+ break;
+ case GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB:
+ {
+ struct gl_buffer_object *buf =
+ ctx->Texture.Unit[ctx->Texture.CurrentUnit]
+ .CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObject;
+ v->value_int = buf ? buf->Name : 0;
+ }
+ break;
+ case GL_TEXTURE_BUFFER_FORMAT_ARB:
+ v->value_int = ctx->Texture.Unit[ctx->Texture.CurrentUnit]
+ .CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObjectFormat;
+ break;
+
}
}