summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
diff options
context:
space:
mode:
authorFredrik Höglund <fredrik@kde.org>2013-04-04 22:15:13 +0200
committerFredrik Höglund <fredrik@kde.org>2013-11-07 16:20:45 +0100
commitfb370f89dbebe4be989d994719449507d523f2c6 (patch)
tree2d669a9bf6764a49ab49933b5820d975a5563c3b /src/mesa/main/get.c
parent59b01ca252bd6706f08cd80a864819d71dfe741c (diff)
downloadexternal_mesa3d-fb370f89dbebe4be989d994719449507d523f2c6.zip
external_mesa3d-fb370f89dbebe4be989d994719449507d523f2c6.tar.gz
external_mesa3d-fb370f89dbebe4be989d994719449507d523f2c6.tar.bz2
mesa: Add Get* support for ARB_vertex_attrib_binding
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index a0dd7cf..eee8550 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1740,6 +1740,30 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
goto invalid_value;
v->value_int64 = ctx->AtomicBufferBindings[index].Size;
return TYPE_INT64;
+
+ case GL_VERTEX_BINDING_DIVISOR:
+ if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_instanced_arrays)
+ goto invalid_enum;
+ if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ goto invalid_value;
+ v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].InstanceDivisor;
+ return TYPE_INT;
+
+ case GL_VERTEX_BINDING_OFFSET:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum;
+ if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ goto invalid_value;
+ v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Offset;
+ return TYPE_INT;
+
+ case GL_VERTEX_BINDING_STRIDE:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum;
+ if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ goto invalid_value;
+ v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
+ return TYPE_INT;
}
invalid_enum: