i965g: propogate nr_cbufs into wm prog key
authorKeith Whitwell <keithw@vmware.com>
Fri, 6 Nov 2009 12:51:26 +0000 (12:51 +0000)
committerKeith Whitwell <keithw@vmware.com>
Fri, 6 Nov 2009 12:51:26 +0000 (12:51 +0000)
src/gallium/drivers/i965/brw_context.h
src/gallium/drivers/i965/brw_pipe_fb.c
src/gallium/drivers/i965/brw_wm.c

index 05fc9d45b568b0d87c66de0f19f3a0788a8138ee..f53b92d4f53d692ece970cdaca6ca2a04ca60491 100644 (file)
@@ -209,6 +209,7 @@ struct brw_sampler {
 #define PIPE_NEW_QUERY                  0x80000
 #define PIPE_NEW_SCISSOR                0x100000
 #define PIPE_NEW_BOUND_TEXTURES         0x200000
+#define PIPE_NEW_NR_CBUFS               0x400000
 
 
 
index d9b70f4eefd80470ae81f7a5372ab62e914747e8..f65f45fb844addf13263dd47b5560a449c8abf2d 100644 (file)
@@ -38,7 +38,10 @@ static void brw_set_framebuffer_state( struct pipe_context *pipe,
       }
    }
    
-   brw->curr.fb.nr_cbufs = fb->nr_cbufs;
+   if (brw->curr.fb.nr_cbufs != fb->nr_cbufs) {
+      brw->curr.fb.nr_cbufs = fb->nr_cbufs;
+      brw->state.dirty.mesa |= PIPE_NEW_NR_CBUFS;
+   }
 }
 
 
index 7f2cb152563172c3d1bab896f3622e348105e575..8589aa22a88b22a9adee317811541316909f5498 100644 (file)
@@ -259,6 +259,10 @@ static void brw_wm_populate_key( struct brw_context *brw,
    /* CACHE_NEW_VS_PROG */
    key->vp_nr_outputs = brw->vs.prog_data->nr_outputs;
 
+   key->nr_cbufs = brw->curr.fb.nr_cbufs;
+
+   key->nr_inputs = brw->curr.fragment_shader->info.num_inputs;
+
    /* The unique fragment program ID */
    key->program_string_id = brw->curr.fragment_shader->id;
 }
@@ -294,6 +298,7 @@ const struct brw_tracked_state brw_wm_prog = {
       .mesa  = (PIPE_NEW_FRAGMENT_SHADER |
                PIPE_NEW_DEPTH_STENCIL_ALPHA |
                PIPE_NEW_RAST |
+               PIPE_NEW_NR_CBUFS |
                PIPE_NEW_BOUND_TEXTURES),
       .brw   = (BRW_NEW_WM_INPUT_DIMENSIONS |
                BRW_NEW_REDUCED_PRIMITIVE),