i965: Fix failure to upload new constant data when changing programs.
This is fallout from the ffvertex_prog.c work. It doesn't call ProgramStringNotify, so we don't set param_state, so we wouldn't track when VP parameters changed, and constants wouldn't get uploaded. Instead, remove param_state entirely and just use the real value that we want to be tracking. Fixes rendering in openarena since BRW_NEW_BATCH got disentangled from BRW_NEW_INDICES. Bug #18822.
This commit is contained in:
@@ -158,7 +158,6 @@ struct brw_state_flags {
|
||||
struct brw_vertex_program {
|
||||
struct gl_vertex_program program;
|
||||
GLuint id;
|
||||
GLuint param_state; /* flags indicating state tracked by params */
|
||||
};
|
||||
|
||||
|
||||
@@ -166,7 +165,6 @@ struct brw_vertex_program {
|
||||
struct brw_fragment_program {
|
||||
struct gl_fragment_program program;
|
||||
GLuint id;
|
||||
GLuint param_state; /* flags indicating state tracked by params */
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -184,8 +184,8 @@ static void prepare_constant_buffer(struct brw_context *brw)
|
||||
* function will also be called whenever fp or vp changes.
|
||||
*/
|
||||
brw->curbe.tracked_state.dirty.mesa = (_NEW_TRANSFORM|_NEW_PROJECTION);
|
||||
brw->curbe.tracked_state.dirty.mesa |= vp->param_state;
|
||||
brw->curbe.tracked_state.dirty.mesa |= fp->param_state;
|
||||
brw->curbe.tracked_state.dirty.mesa |= vp->program.Base.Parameters->StateFlags;
|
||||
brw->curbe.tracked_state.dirty.mesa |= fp->program.Base.Parameters->StateFlags;
|
||||
|
||||
if (sz == 0) {
|
||||
|
||||
|
||||
@@ -117,7 +117,6 @@ static void brwProgramStringNotify( GLcontext *ctx,
|
||||
if (p == fp)
|
||||
brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM;
|
||||
p->id = brw->program_id++;
|
||||
p->param_state = p->program.Base.Parameters->StateFlags;
|
||||
}
|
||||
else if (target == GL_VERTEX_PROGRAM_ARB) {
|
||||
struct brw_context *brw = brw_context(ctx);
|
||||
@@ -129,7 +128,6 @@ static void brwProgramStringNotify( GLcontext *ctx,
|
||||
_mesa_insert_mvp_code(ctx, &p->program);
|
||||
}
|
||||
p->id = brw->program_id++;
|
||||
p->param_state = p->program.Base.Parameters->StateFlags;
|
||||
|
||||
/* Also tell tnl about it:
|
||||
*/
|
||||
|
||||
@@ -426,10 +426,6 @@ static struct prog_src_register search_or_add_param5(struct brw_wm_compile *c,
|
||||
|
||||
idx = _mesa_add_state_reference( paramList, tokens );
|
||||
|
||||
/* Recalculate state dependency:
|
||||
*/
|
||||
c->fp->param_state = paramList->StateFlags;
|
||||
|
||||
return src_reg(PROGRAM_STATE_VAR, idx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user