diff options
author | Paul Berry <[email protected]> | 2014-01-09 11:16:27 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-01-21 20:25:02 -0800 |
commit | 3b22146dc714b6090f7423abbc4df53d7d1fdaa9 (patch) | |
tree | b59bef08624870671092f9906585869f6f9aeac9 /src/mesa/main/state.c | |
parent | cd18ba1c7aba66f2dd7cdbe2cf3b4a803c241d10 (diff) |
mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an array.
These are replaced with
ctx->Shader.CurrentProgram[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' ')' \
-print0 | xargs -0 sed -i \
-e 's/\.CurrentVertexProgram/.CurrentProgram[MESA_SHADER_VERTEX]/g' \
-e 's/\.CurrentGeometryProgram/.CurrentProgram[MESA_SHADER_GEOMETRY]/g' \
-e 's/\.CurrentFragmentProgram/.CurrentProgram[MESA_SHADER_FRAGMENT]/g'
Reviewed-by: Chris Forbes <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r-- | src/mesa/main/state.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 87f6553a5f9..bde548f68d8 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -94,9 +94,9 @@ update_program_enables(struct gl_context *ctx) static GLbitfield update_program(struct gl_context *ctx) { - const struct gl_shader_program *vsProg = ctx->Shader.CurrentVertexProgram; - const struct gl_shader_program *gsProg = ctx->Shader.CurrentGeometryProgram; - struct gl_shader_program *fsProg = ctx->Shader.CurrentFragmentProgram; + const struct gl_shader_program *vsProg = ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; + const struct gl_shader_program *gsProg = ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]; + struct gl_shader_program *fsProg = ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT]; const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current; @@ -307,7 +307,7 @@ update_multisample(struct gl_context *ctx) static void update_twoside(struct gl_context *ctx) { - if (ctx->Shader.CurrentVertexProgram || + if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] || ctx->VertexProgram._Enabled) { ctx->VertexProgram._TwoSideEnabled = ctx->VertexProgram.TwoSideEnabled; } else { |