diff options
author | Dave Airlie <airliedfreedesktop.org> | 2005-01-30 06:24:30 +0000 |
---|---|---|
committer | Dave Airlie <airliedfreedesktop.org> | 2005-01-30 06:24:30 +0000 |
commit | 3aa69b39bf9a79f97f1e049e3a8429cdfc4389f4 (patch) | |
tree | 5d615e90d671529d865437b1259feff55bb68cc1 | |
parent | 5ff53cb448aa8dcf752ceaa9eb47a7c8a9c3ab0c (diff) |
add number of passes count to ati_fragment_shader
-rw-r--r-- | src/mesa/main/mtypes.h | 1 | ||||
-rw-r--r-- | src/mesa/shader/atifragshader.c | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index dc3dcbba1a..416f77d25c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1756,6 +1756,7 @@ struct ati_fragment_shader struct program Base; struct atifs_instruction *Instructions; GLfloat Constants[8][4]; + GLint NumPasses; GLint cur_pass; }; diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index 2a8cf9016a..d8df8f518b 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -231,7 +231,8 @@ _mesa_EndFragmentShaderATI(void) #endif ctx->ATIFragmentShader.Compiling = 0; - + ctx->ATIFragmentShader.Current->NumPasses = ctx->ATIFragmentShader.Current->cur_pass; + ctx->ATIFragmentShader.Current->cur_pass=0; #if MESA_DEBUG_ATI_FS for (i = 0; i < curProg->Base.NumInstructions; i++) { GLuint op0 = curProg->Instructions[i].Opcode[0]; @@ -255,6 +256,9 @@ _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle) GLint ci; struct atifs_instruction *curI; + if (ctx->ATIFragmentShader.Current->cur_pass==1) + ctx->ATIFragmentShader.Current->cur_pass=2; + new_inst(curProg); ci = curProg->Base.NumInstructions - 1; /* some validation @@ -287,6 +291,10 @@ _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle) GLint ci; struct atifs_instruction *curI; + if (ctx->ATIFragmentShader.Current->cur_pass==1) + ctx->ATIFragmentShader.Current->cur_pass=2; + + new_inst(curProg); ci = curProg->Base.NumInstructions - 1; @@ -318,6 +326,9 @@ _mesa_FragmentOpXATI(GLint optype, GLuint arg_count, GLenum op, GLuint dst, GLint ci; struct atifs_instruction *curI; + if (ctx->ATIFragmentShader.Current->cur_pass==0) + ctx->ATIFragmentShader.Current->cur_pass=1; + /* decide whether this is a new instruction or not ... all color instructions are new */ if (optype == 0) new_inst(curProg); |