summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-09 11:16:27 -0800
committerPaul Berry <[email protected]>2014-01-21 20:25:02 -0800
commit3b22146dc714b6090f7423abbc4df53d7d1fdaa9 (patch)
treeb59bef08624870671092f9906585869f6f9aeac9 /src/mesa/main/texstate.c
parentcd18ba1c7aba66f2dd7cdbe2cf3b4a803c241d10 (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/texstate.c')
-rw-r--r--src/mesa/main/texstate.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 7720965a8c8..b6da76d4213 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -532,19 +532,19 @@ update_texture_state( struct gl_context *ctx )
struct gl_program *gprog = NULL;
GLbitfield enabledFragUnits = 0x0;
- if (ctx->Shader.CurrentVertexProgram &&
- ctx->Shader.CurrentVertexProgram->LinkStatus) {
- vprog = ctx->Shader.CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
+ if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] &&
+ ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]->LinkStatus) {
+ vprog = ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
}
- if (ctx->Shader.CurrentGeometryProgram &&
- ctx->Shader.CurrentGeometryProgram->LinkStatus) {
- gprog = ctx->Shader.CurrentGeometryProgram->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program;
+ if (ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY] &&
+ ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]->LinkStatus) {
+ gprog = ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program;
}
- if (ctx->Shader.CurrentFragmentProgram &&
- ctx->Shader.CurrentFragmentProgram->LinkStatus) {
- fprog = ctx->Shader.CurrentFragmentProgram->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program;
+ if (ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] &&
+ ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT]->LinkStatus) {
+ fprog = ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT]->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program;
}
else if (ctx->FragmentProgram._Enabled) {
fprog = &ctx->FragmentProgram.Current->Base;