summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-08 10:00:28 -0800
committerPaul Berry <[email protected]>2014-01-09 09:31:01 -0800
commit84732a982c3eeaca2e2809532c8422dc5f7045c1 (patch)
tree851c411dc92ad2192d2c63db0898dec46a200611 /src/mesa/main/get.c
parent9b96be595b93544266436ec3b22b2cbd349d180c (diff)
mesa: replace ctx->Const.{Vertex,Fragment,Geomtery}Program with an array.
These are replaced with ctx->Const.Program[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}]. In patches to follow, this will allow us to replace a lot of ad-hoc logic with a variable index into the array. With the exception of the changes to mtypes.h, this patch was generated entirely by the command: find src -type f '(' -iname '*.c' -o -iname '*.cpp' -o -iname '*.py' \ -o -iname '*.y' ')' -print0 | xargs -0 sed -i \ -e 's/Const\.VertexProgram/Const.Program[MESA_SHADER_VERTEX]/g' \ -e 's/Const\.GeometryProgram/Const.Program[MESA_SHADER_GEOMETRY]/g' \ -e 's/Const\.FragmentProgram/Const.Program[MESA_SHADER_FRAGMENT]/g' Suggested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index c45a8d156c3..6342fbefca4 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -871,11 +871,11 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
v->value_float = ctx->Color.AlphaRefUnclamped;
break;
case GL_MAX_VERTEX_UNIFORM_VECTORS:
- v->value_int = ctx->Const.VertexProgram.MaxUniformComponents / 4;
+ v->value_int = ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4;
break;
case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
- v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4;
+ v->value_int = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4;
break;
/* GL_ARB_texture_buffer_object */
@@ -1769,7 +1769,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
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)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].InstanceDivisor;
return TYPE_INT;
@@ -1777,7 +1777,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
case GL_VERTEX_BINDING_OFFSET:
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum;
- if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Offset;
return TYPE_INT;
@@ -1785,7 +1785,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
case GL_VERTEX_BINDING_STRIDE:
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum;
- if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
return TYPE_INT;