r200/r300/r500: add _NEW_PROGRAM_CONSTANTS flag
authorBrian Paul <brianp@vmware.com>
Wed, 22 Apr 2009 14:59:47 +0000 (08:59 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 22 Apr 2009 14:59:47 +0000 (08:59 -0600)
Make sure we detect constant buffer changes indicated by the new flag.
Should be able to remove _NEW_PROGRAM (and _NEW_MODELVIEW, _NEW_LIGHT, etc)
from several places (someday.

src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/r300/r300_fragprog.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r500_fragprog.c

index 2fcc87c0f5a6eccf2b863ec605aea103a7f31e2c..28ba5f49bc00e811de5066fef6b1636bd66c4022 100644 (file)
@@ -2484,7 +2484,7 @@ void r200ValidateState( GLcontext *ctx )
      r200UpdateDrawBuffer(ctx);
    }
 
-   if (new_state & (_NEW_TEXTURE | _NEW_PROGRAM)) {
+   if (new_state & (_NEW_TEXTURE | _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS)) {
       r200UpdateTextureState( ctx );
       new_state |= rmesa->NewGLState; /* may add TEXTURE_MATRIX */
       r200UpdateLocalViewer( ctx );
@@ -2523,6 +2523,7 @@ void r200ValidateState( GLcontext *ctx )
    }
 
    if (new_state & (_NEW_PROGRAM|
+                    _NEW_PROGRAM_CONSTANTS |
    /* need to test for pretty much anything due to possible parameter bindings */
        _NEW_MODELVIEW|_NEW_PROJECTION|_NEW_TRANSFORM|
        _NEW_LIGHT|_NEW_TEXTURE|_NEW_TEXTURE_MATRIX|
index 873cde44144394c361ee09f31478dd1f70277b4a..2f45429cf27218e0a7946b9ee259ce1dd478cadd 100644 (file)
@@ -470,7 +470,8 @@ void r300TranslateFragmentShader(r300ContextPtr r300,
                        fp->translated = GL_TRUE;
                if (fp->error || (RADEON_DEBUG & DEBUG_PIXEL))
                        r300FragmentProgramDump(fp, &fp->code);
-               r300UpdateStateParameters(r300->radeon.glCtx, _NEW_PROGRAM);
+               r300UpdateStateParameters(r300->radeon.glCtx, _NEW_PROGRAM |
+                                          _NEW_PROGRAM_CONSTANTS);
        }
 
        update_params(r300, fp);
index 8095538ff94c5d57f3b171397de1f8a8667fecfa..2589f09cc88d64138c8be9266c6a3d15f7506694 100644 (file)
@@ -1107,7 +1107,7 @@ void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state)
        struct gl_program_parameter_list *paramList;
        GLuint i;
 
-       if (!(new_state & (_NEW_BUFFERS | _NEW_PROGRAM)))
+       if (!(new_state & (_NEW_BUFFERS | _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS)))
                return;
 
        fp = (struct r300_fragment_program *)ctx->FragmentProgram._Current;
@@ -2355,11 +2355,12 @@ void r300UpdateShaders(r300ContextPtr rmesa)
                        hw_tcl_on = future_hw_tcl_on = 0;
                        r300ResetHwState(rmesa);
 
-                       r300UpdateStateParameters(ctx, _NEW_PROGRAM);
+                       r300UpdateStateParameters(ctx, _NEW_PROGRAM |
+                                                  _NEW_PROGRAM_CONSTANTS);
                        return;
                }
        }
-       r300UpdateStateParameters(ctx, _NEW_PROGRAM);
+       r300UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
 }
 
 static const GLfloat *get_fragmentprogram_constant(GLcontext *ctx,
index 292573de893e4282d12c702ca390c5b4598d797d..300559d0b4de466a66ef06b446a1ce6e911e8c6b 100644 (file)
@@ -501,7 +501,8 @@ void r500TranslateFragmentShader(r300ContextPtr r300,
 
                _mesa_reference_program(r300->radeon.glCtx, &compiler.program, 0);
 
-               r300UpdateStateParameters(r300->radeon.glCtx, _NEW_PROGRAM);
+               r300UpdateStateParameters(r300->radeon.glCtx, _NEW_PROGRAM |
+                                          _NEW_PROGRAM_CONSTANTS);
 
                if (RADEON_DEBUG & DEBUG_PIXEL) {
                        if (fp->translated) {