r200/r300/r500: add _NEW_PROGRAM_CONSTANTS flag
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.
This commit is contained in:
@@ -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|
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user