i965: Update gen6 SF state on fragment program change too.
authorEric Anholt <eric@anholt.net>
Sat, 4 Dec 2010 02:20:42 +0000 (18:20 -0800)
committerEric Anholt <eric@anholt.net>
Sun, 5 Dec 2010 00:26:55 +0000 (16:26 -0800)
SF state depends on what inputs there are to the fragment program, not
just the outputs of the VS.

src/mesa/drivers/dri/i965/gen6_sf_state.c

index 06ac5d49a0f92f55133babcffd556e60f04e3999..476bf531c6415b641a9ea7c907963eca2f7b48c7 100644 (file)
@@ -67,6 +67,7 @@ upload_sf_state(struct brw_context *brw)
    struct gl_context *ctx = &intel->ctx;
    /* CACHE_NEW_VS_PROG */
    uint32_t num_inputs = brw_count_bits(brw->vs.prog_data->outputs_written);
+   /* BRW_NEW_FRAGMENT_PROGRAM */
    uint32_t num_outputs = brw_count_bits(brw->fragment_program->Base.InputsRead);
    uint32_t dw1, dw2, dw3, dw4, dw16;
    int i;
@@ -247,7 +248,8 @@ const struct brw_tracked_state gen6_sf_state = {
                _NEW_BUFFERS |
                _NEW_POINT |
                _NEW_TRANSFORM),
-      .brw   = BRW_NEW_CONTEXT,
+      .brw   = (BRW_NEW_CONTEXT |
+               BRW_NEW_FRAGMENT_PROGRAM),
       .cache = CACHE_NEW_VS_PROG
    },
    .emit = upload_sf_state,