From: Keith Whitwell Date: Fri, 6 Nov 2009 12:51:26 +0000 (+0000) Subject: i965g: propogate nr_cbufs into wm prog key X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3e14a482daf5e69331efac69711534a8b66118e4;p=mesa.git i965g: propogate nr_cbufs into wm prog key --- diff --git a/src/gallium/drivers/i965/brw_context.h b/src/gallium/drivers/i965/brw_context.h index 05fc9d45b56..f53b92d4f53 100644 --- a/src/gallium/drivers/i965/brw_context.h +++ b/src/gallium/drivers/i965/brw_context.h @@ -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 diff --git a/src/gallium/drivers/i965/brw_pipe_fb.c b/src/gallium/drivers/i965/brw_pipe_fb.c index d9b70f4eefd..f65f45fb844 100644 --- a/src/gallium/drivers/i965/brw_pipe_fb.c +++ b/src/gallium/drivers/i965/brw_pipe_fb.c @@ -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; + } } diff --git a/src/gallium/drivers/i965/brw_wm.c b/src/gallium/drivers/i965/brw_wm.c index 7f2cb152563..8589aa22a88 100644 --- a/src/gallium/drivers/i965/brw_wm.c +++ b/src/gallium/drivers/i965/brw_wm.c @@ -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),