diff options
author | Paul Berry <[email protected]> | 2014-01-08 10:00:28 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-01-09 09:31:01 -0800 |
commit | 84732a982c3eeaca2e2809532c8422dc5f7045c1 (patch) | |
tree | 851c411dc92ad2192d2c63db0898dec46a200611 /src/glsl/main.cpp | |
parent | 9b96be595b93544266436ec3b22b2cbd349d180c (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/glsl/main.cpp')
-rw-r--r-- | src/glsl/main.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index 736689eb75c..03b7c786b7d 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -62,20 +62,20 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 0; ctx->Const.MaxTextureUnits = 8; - ctx->Const.VertexProgram.MaxAttribs = 8; - ctx->Const.VertexProgram.MaxTextureImageUnits = 0; - ctx->Const.VertexProgram.MaxUniformComponents = 128 * 4; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 32; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 8; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 128 * 4; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32; - ctx->Const.FragmentProgram.MaxTextureImageUnits = + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits; - ctx->Const.FragmentProgram.MaxUniformComponents = 16 * 4; - ctx->Const.FragmentProgram.MaxInputComponents = - ctx->Const.VertexProgram.MaxOutputComponents; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 16 * 4; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ - ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4; + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; break; case 110: case 120: @@ -88,20 +88,20 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 2; ctx->Const.MaxTextureUnits = 2; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxTextureImageUnits = 0; - ctx->Const.VertexProgram.MaxUniformComponents = 512; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 32; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32; - ctx->Const.FragmentProgram.MaxTextureImageUnits = + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits; - ctx->Const.FragmentProgram.MaxUniformComponents = 64; - ctx->Const.FragmentProgram.MaxInputComponents = - ctx->Const.VertexProgram.MaxOutputComponents; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ - ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4; + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; break; case 130: case 140: @@ -114,19 +114,19 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 8; ctx->Const.MaxTextureUnits = 2; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxTextureImageUnits = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 1024; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 64; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64; - ctx->Const.FragmentProgram.MaxTextureImageUnits = 16; - ctx->Const.FragmentProgram.MaxUniformComponents = 1024; - ctx->Const.FragmentProgram.MaxInputComponents = - ctx->Const.VertexProgram.MaxOutputComponents; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ - ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4; + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; break; case 150: case 330: @@ -138,28 +138,28 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 8; ctx->Const.MaxTextureUnits = 2; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxTextureImageUnits = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 1024; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 64; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64; - ctx->Const.GeometryProgram.MaxTextureImageUnits = 16; - ctx->Const.GeometryProgram.MaxUniformComponents = 1024; - ctx->Const.GeometryProgram.MaxInputComponents = - ctx->Const.VertexProgram.MaxOutputComponents; - ctx->Const.GeometryProgram.MaxOutputComponents = 128; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = 128; - ctx->Const.FragmentProgram.MaxTextureImageUnits = 16; - ctx->Const.FragmentProgram.MaxUniformComponents = 1024; - ctx->Const.FragmentProgram.MaxInputComponents = - ctx->Const.GeometryProgram.MaxOutputComponents; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ ctx->Const.MaxCombinedTextureImageUnits = - ctx->Const.VertexProgram.MaxTextureImageUnits - + ctx->Const.GeometryProgram.MaxTextureImageUnits - + ctx->Const.FragmentProgram.MaxTextureImageUnits; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits + + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits + + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; ctx->Const.MaxGeometryOutputVertices = 256; ctx->Const.MaxGeometryTotalOutputComponents = 1024; @@ -178,18 +178,18 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 0; ctx->Const.MaxTextureUnits = 0; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxTextureImageUnits = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 1024; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 16 * 4; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 16 * 4; - ctx->Const.FragmentProgram.MaxTextureImageUnits = 16; - ctx->Const.FragmentProgram.MaxUniformComponents = 224; - ctx->Const.FragmentProgram.MaxInputComponents = 15 * 4; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 224; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 15 * 4; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ - ctx->Const.MaxVarying = ctx->Const.FragmentProgram.MaxInputComponents / 4; + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4; break; } |