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 <brianp@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -96,30 +96,30 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
|
||||
this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes;
|
||||
this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits;
|
||||
this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits;
|
||||
this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
|
||||
this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
|
||||
this->Const.MaxVertexTextureImageUnits = ctx->Const.VertexProgram.MaxTextureImageUnits;
|
||||
this->Const.MaxVertexAttribs = ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs;
|
||||
this->Const.MaxVertexUniformComponents = ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents;
|
||||
this->Const.MaxVertexTextureImageUnits = ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits;
|
||||
this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
|
||||
this->Const.MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits;
|
||||
this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
|
||||
this->Const.MaxTextureImageUnits = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
|
||||
this->Const.MaxFragmentUniformComponents = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents;
|
||||
this->Const.MinProgramTexelOffset = ctx->Const.MinProgramTexelOffset;
|
||||
this->Const.MaxProgramTexelOffset = ctx->Const.MaxProgramTexelOffset;
|
||||
|
||||
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
|
||||
|
||||
/* 1.50 constants */
|
||||
this->Const.MaxVertexOutputComponents = ctx->Const.VertexProgram.MaxOutputComponents;
|
||||
this->Const.MaxGeometryInputComponents = ctx->Const.GeometryProgram.MaxInputComponents;
|
||||
this->Const.MaxGeometryOutputComponents = ctx->Const.GeometryProgram.MaxOutputComponents;
|
||||
this->Const.MaxFragmentInputComponents = ctx->Const.FragmentProgram.MaxInputComponents;
|
||||
this->Const.MaxGeometryTextureImageUnits = ctx->Const.GeometryProgram.MaxTextureImageUnits;
|
||||
this->Const.MaxVertexOutputComponents = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
|
||||
this->Const.MaxGeometryInputComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
|
||||
this->Const.MaxGeometryOutputComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents;
|
||||
this->Const.MaxFragmentInputComponents = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents;
|
||||
this->Const.MaxGeometryTextureImageUnits = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits;
|
||||
this->Const.MaxGeometryOutputVertices = ctx->Const.MaxGeometryOutputVertices;
|
||||
this->Const.MaxGeometryTotalOutputComponents = ctx->Const.MaxGeometryTotalOutputComponents;
|
||||
this->Const.MaxGeometryUniformComponents = ctx->Const.GeometryProgram.MaxUniformComponents;
|
||||
this->Const.MaxGeometryUniformComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents;
|
||||
|
||||
this->Const.MaxVertexAtomicCounters = ctx->Const.VertexProgram.MaxAtomicCounters;
|
||||
this->Const.MaxGeometryAtomicCounters = ctx->Const.GeometryProgram.MaxAtomicCounters;
|
||||
this->Const.MaxFragmentAtomicCounters = ctx->Const.FragmentProgram.MaxAtomicCounters;
|
||||
this->Const.MaxVertexAtomicCounters = ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters;
|
||||
this->Const.MaxGeometryAtomicCounters = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters;
|
||||
this->Const.MaxFragmentAtomicCounters = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters;
|
||||
this->Const.MaxCombinedAtomicCounters = ctx->Const.MaxCombinedAtomicCounters;
|
||||
this->Const.MaxAtomicBufferBindings = ctx->Const.MaxAtomicBufferBindings;
|
||||
|
||||
|
Reference in New Issue
Block a user