i965/fs: Move some flags that affect code generation to fs_visitor.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 14 May 2014 07:08:58 +0000 (00:08 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 19 May 2014 06:35:19 +0000 (23:35 -0700)
runtime_check_aads_emit isn't actually used currently, but I believe
we should be using it on Gen4-5, so I haven't eliminated it.
See https://bugs.freedesktop.org/show_bug.cgi?id=78679 for details.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_iz.cpp

index 10a9524ad1712c0cff29f0c0b39e4ad77fe3f3b1..03d734f6e016bc2240f41d270bba00399f04522b 100644 (file)
@@ -2863,7 +2863,7 @@ fs_visitor::setup_payload_gen6()
    /* R58-59: interp W for 32-pixel. */
 
    if (fp->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
-      c->source_depth_to_render_target = true;
+      source_depth_to_render_target = true;
    }
 }
 
index 28118647905a085797ad9d383c83281cba371013..435d68caa6032d1bc009e3f9e41442f532d3cc81 100644 (file)
@@ -566,6 +566,9 @@ public:
       uint8_t num_regs;
    } payload;
 
+   bool source_depth_to_render_target;
+   bool runtime_check_aads_emit;
+
    fs_reg pixel_x;
    fs_reg pixel_y;
    fs_reg wpos_w;
index 64cf8aede219cfcc89743696a4e670b98a3ef5c2..646fbf591a827f5c6cb7d83586bd7252ec3d8d17 100644 (file)
@@ -2793,7 +2793,7 @@ fs_visitor::emit_fb_writes()
    if (src0_alpha_to_render_target)
       nr += reg_width;
 
-   if (c->source_depth_to_render_target) {
+   if (source_depth_to_render_target) {
       if (brw->gen == 6) {
         /* For outputting oDepth on gen6, SIMD8 writes have to be
          * used.  This would require SIMD8 moves of each half to
@@ -2975,6 +2975,8 @@ fs_visitor::fs_visitor(struct brw_context *brw,
    memset(&this->payload, 0, sizeof(this->payload));
    memset(this->outputs, 0, sizeof(this->outputs));
    memset(this->output_components, 0, sizeof(this->output_components));
+   this->source_depth_to_render_target = false;
+   this->runtime_check_aads_emit = false;
    this->first_non_payload_grf = 0;
    this->max_grf = brw->gen >= 7 ? GEN7_MRF_HACK_START : BRW_MAX_GRF;
 
index b3f383d2cdc92baa6eee1480d365eff32a9122a6..5721d6fed76d6d6441ead8dafe3030b13234f850 100644 (file)
@@ -83,9 +83,6 @@ struct brw_wm_prog_key {
 struct brw_wm_compile {
    struct brw_wm_prog_key key;
    struct brw_wm_prog_data prog_data;
-
-   GLuint source_depth_to_render_target:1;
-   GLuint runtime_check_aads_emit:1;
 };
 
 /**
index f51802b860f99e368b0d1160d138254d10ba065e..5f719f622fa9f385247ff01cd4c5b8c1aa29533e 100644 (file)
@@ -148,12 +148,12 @@ void fs_visitor::setup_payload_gen4()
    }
 
    if (wm_iz_table[lookup].sd_to_rt || kill_stats_promoted_workaround)
-      c->source_depth_to_render_target = 1;
+      source_depth_to_render_target = true;
 
    if (wm_iz_table[lookup].ds_present || c->key.line_aa != AA_NEVER) {
       payload.aa_dest_stencil_reg = reg;
-      c->runtime_check_aads_emit = (!wm_iz_table[lookup].ds_present &&
-                                    c->key.line_aa == AA_SOMETIMES);
+      runtime_check_aads_emit =
+         !wm_iz_table[lookup].ds_present && c->key.line_aa == AA_SOMETIMES;
       reg++;
    }