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/shaderapi.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/shaderapi.c')
-rw-r--r-- | src/mesa/main/shaderapi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 2ab0a0cfde2..d57748c93ad 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -130,10 +130,10 @@ _mesa_init_shader_state(struct gl_context *ctx) void _mesa_free_shader_state(struct gl_context *ctx) { - _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentVertexProgram, NULL); - _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentGeometryProgram, + _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX], NULL); + _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY], NULL); - _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentFragmentProgram, + _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT], NULL); _mesa_reference_shader_program(ctx, &ctx->Shader._CurrentFragmentProgram, NULL); @@ -949,21 +949,21 @@ use_shader_program(struct gl_context *ctx, GLenum type, switch (type) { case GL_VERTEX_SHADER: - target = &ctx->Shader.CurrentVertexProgram; + target = &ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; if ((shProg == NULL) || (shProg->_LinkedShaders[MESA_SHADER_VERTEX] == NULL)) { shProg = NULL; } break; case GL_GEOMETRY_SHADER_ARB: - target = &ctx->Shader.CurrentGeometryProgram; + target = &ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]; if ((shProg == NULL) || (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY] == NULL)) { shProg = NULL; } break; case GL_FRAGMENT_SHADER: - target = &ctx->Shader.CurrentFragmentProgram; + target = &ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT]; if ((shProg == NULL) || (shProg->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL)) { shProg = NULL; |