Module: Mesa
Branch: master
Commit: 9ef33b86855c4d000271774030bd1b19b6d79687
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9ef33b86855c4d000271774030bd1b19b6d79687

Author: Brian Paul <[email protected]>
Date:   Thu Oct 29 14:53:53 2009 -0600

i965: don't use context state in emit_fb_write()

Put the state that we care about in the hash key.
Issue spotted by Keith Whitwell.

---

 src/mesa/drivers/dri/i965/brw_wm.c    |    2 ++
 src/mesa/drivers/dri/i965/brw_wm.h    |    1 +
 src/mesa/drivers/dri/i965/brw_wm_fp.c |    4 ++--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm.c 
b/src/mesa/drivers/dri/i965/brw_wm.c
index 5a2ac1a..eeb2598 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -325,6 +325,8 @@ static void brw_wm_populate_key( struct brw_context *brw,
       key->drawable_height = brw->intel.driDrawable->h;
    }
 
+   key->nr_color_regions = brw->state.nr_color_regions;
+
    /* CACHE_NEW_VS_PROG */
    key->vp_outputs_written = brw->vs.prog_data->outputs_written & 
DO_SETUP_BITS;
 
diff --git a/src/mesa/drivers/dri/i965/brw_wm.h 
b/src/mesa/drivers/dri/i965/brw_wm.h
index f13a958..d0f3060 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.h
+++ b/src/mesa/drivers/dri/i965/brw_wm.h
@@ -67,6 +67,7 @@ struct brw_wm_prog_key {
    GLuint flat_shade:1;
    GLuint linear_color:1;  /**< linear interpolation vs perspective interp */
    GLuint runtime_check_aads_emit:1;
+   GLuint nr_color_regions:2;
    
    GLbitfield proj_attrib_mask; /**< one bit per fragment program attribute */
    GLuint shadowtex_mask:16;
diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c 
b/src/mesa/drivers/dri/i965/brw_wm_fp.c
index d33fd9a..9a0aea8 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_fp.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c
@@ -968,8 +968,8 @@ static void emit_fb_write( struct brw_wm_compile *c )
 
    /* The inst->Aux field is used for FB write target and the EOT marker */
 
-   if (brw->state.nr_color_regions > 1) {
-      for (i = 0 ; i < brw->state.nr_color_regions; i++) {
+   if (c->key.nr_color_regions > 1) {
+      for (i = 0 ; i < c->key.nr_color_regions; i++) {
          outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i);
          last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(), 0),
                                     0, outcolor, payload_r0_depth, outdepth);

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to