aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-05-04 11:44:44 +0000
committerKeith Whitwell <[email protected]>2005-05-04 11:44:44 +0000
commit47b29f511a8e917c65536fde90397d54d2ad23d3 (patch)
treec8db61607defe55b4540af3e4614df9831d2021d /src/mesa/main/state.c
parentc3f764f7bb5a0571ddb0bc8b37aff9d663188d79 (diff)
Add a facility to route all rasterization through a fragment program
which is automatically generated to match the current texture environment state. Introduces a new value ctx->FragmentProgram._Active which is true when either _Enabled is true or there is such a fragment program ready to run. To test out on a driver running the software rasterizer, set MESA_TEX_PROG=t in the environment. It goes without saying that performance is lower for the software rasterizer in this mode.
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r--src/mesa/main/state.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 3cb90447013..540d3ce993c 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -933,6 +933,14 @@ update_program(GLcontext *ctx)
&& ctx->FragmentProgram.Current->Instructions;
ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled
&& ctx->ATIFragmentShader.Current->Instructions;
+
+ ctx->FragmentProgram._Current = ctx->FragmentProgram.Current;
+ ctx->FragmentProgram._Active = ctx->FragmentProgram._Enabled;
+
+ if (ctx->_MaintainTexEnvProgram && !ctx->FragmentProgram._Enabled) {
+ ctx->FragmentProgram._Current = &ctx->_TexEnvProgram;
+ ctx->FragmentProgram._Active = GL_TRUE;
+ }
}
@@ -984,6 +992,11 @@ _mesa_update_state( GLcontext *ctx )
if (new_state & (_NEW_ARRAY | _NEW_PROGRAM))
update_arrays( ctx );
+ if (ctx->_MaintainTexEnvProgram) {
+ if (new_state & (_NEW_TEXTURE | _DD_NEW_SEPARATE_SPECULAR))
+ _mesa_UpdateTexEnvProgram(ctx);
+ }
+
/* ctx->_NeedEyeCoords is now up to date.
*
* If the truth value of this variable has changed, update for the