i965: Fix failure to upload new constant data when changing programs.
authorEric Anholt <eric@anholt.net>
Wed, 3 Dec 2008 19:36:55 +0000 (11:36 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 3 Dec 2008 19:45:16 +0000 (11:45 -0800)
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.

src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_curbe.c
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/brw_wm_fp.c

index 252c070471687c37f64e8e9bd0fff6ba2eb03cb0..77980109cdf1a505a8fed2bf84410c11143b99b8 100644 (file)
@@ -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 */
 };
 
 
index c7bac7b0c522b8ae26f51c318d455e24aed75bf3..fbf473abf66baaa6a3d0a23377c6251dca624076 100644 (file)
@@ -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) {
 
index c38610b24ed3c5aa8f4ff600bb2aceeda23c9cdc..a18dee85e80e40b4cd152484fb9299dff3dc2790 100644 (file)
@@ -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:
        */
index d3e926c328c28ee7172d401bb9420051264fcb3c..7f7b957cbe892bfde9c390c55f4ecc44e4780d38 100644 (file)
@@ -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);
 }