From 84732a982c3eeaca2e2809532c8422dc5f7045c1 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Wed, 8 Jan 2014 10:00:28 -0800 Subject: 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 Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke --- src/mesa/main/shaderapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/shaderapi.c') diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 16a9a384c3b..6042fa896d5 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1533,10 +1533,10 @@ _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, switch (shadertype) { case GL_VERTEX_SHADER: - limits = &ctx->Const.VertexProgram; + limits = &ctx->Const.Program[MESA_SHADER_VERTEX]; break; case GL_FRAGMENT_SHADER: - limits = &ctx->Const.FragmentProgram; + limits = &ctx->Const.Program[MESA_SHADER_FRAGMENT]; break; default: _mesa_error(ctx, GL_INVALID_ENUM, -- cgit v1.2.3