i965/fs: Remove brw_wm_compile::computes_depth field.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 20 Nov 2012 20:21:40 +0000 (12:21 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 27 Nov 2012 03:52:33 +0000 (19:52 -0800)
Everybody determines this by checking if fp's OutputsWritten field
contains the FRAG_RESULT_DEPTH bit.  Rather than having payload setup
check this and set the computes_depth flag, we can just do the check in
the only place that actually used it: emit_fb_writes().

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_wm.c
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_iz.c

index b6f777109039223e03fa8409a8d9702803f84266..5d94181d64de2967ece5ef1c987ed0a54198fb9c 100644 (file)
@@ -2049,7 +2049,7 @@ fs_visitor::emit_fb_writes()
         fail("Missing support for simd16 depth writes on gen6\n");
       }
 
-      if (c->computes_depth) {
+      if (fp->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
         /* Hand over gl_FragDepth. */
         assert(this->frag_depth.file != BAD_FILE);
         emit(MOV(fs_reg(MRF, nr), this->frag_depth));
index e2d16db51ac9180882f5681777e3bc66dfe86a99..9b2c58c3aa33d6c7aefec56321367bc2d6a29922 100644 (file)
@@ -160,7 +160,6 @@ brw_wm_payload_setup(struct brw_context *brw,
       if (c->fp->program.Base.OutputsWritten &
          BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
         c->source_depth_to_render_target = true;
-        c->computes_depth = true;
       }
    } else {
       brw_wm_lookup_iz(intel, c);
index 46d4416ba8f48061cf9087d29088a76ab57e5771..c017866c421b88b3d4b66239315aa8e2e13cac50 100644 (file)
@@ -89,7 +89,6 @@ struct brw_wm_compile {
    uint8_t dest_depth_reg;
    uint8_t barycentric_coord_reg[BRW_WM_BARYCENTRIC_INTERP_MODE_COUNT];
    uint8_t nr_payload_regs;
-   GLuint computes_depth:1;    /* could be derived from program string */
    GLuint source_depth_to_render_target:1;
    GLuint runtime_check_aads_emit:1;
 
index 878f5d079deb91a239c68633c0869bbb7e4535c8..147753ab424df06b041072113a0fa7aa3f756854 100644 (file)
@@ -142,9 +142,6 @@ void brw_wm_lookup_iz(struct intel_context *intel,
       kill_stats_promoted_workaround = true;
    }
 
-   if (lookup & IZ_PS_COMPUTES_DEPTH_BIT)
-      c->computes_depth = 1;
-
    if (wm_iz_table[lookup].sd_present || uses_depth ||
        kill_stats_promoted_workaround) {
       c->source_depth_reg = reg;