<div dir="ltr">Does this mean we can delete the field from brw_fs_generator?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 24, 2016 at 12:18 AM, Francisco Jerez <span dir="ltr"><<a href="mailto:currojerez@riseup.net" target="_blank">currojerez@riseup.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Most of these are bugs because the intended execution size of an<br>
instruction and the dispatch width of the shader aren't necessarily<br>
the same (especially in SIMD32 programs).<br>
---<br>
 src/mesa/drivers/dri/i965/brw_eu.h             |  1 -<br>
 src/mesa/drivers/dri/i965/brw_eu_emit.c        |  3 +--<br>
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 13 +++++++------<br>
 3 files changed, 8 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h<br>
index 91e3401..b057f17 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_eu.h<br>
+++ b/src/mesa/drivers/dri/i965/brw_eu.h<br>
@@ -281,7 +281,6 @@ void brw_svb_write(struct brw_codegen *p,<br>
                    bool   send_commit_msg);<br>
<br>
 void brw_fb_WRITE(struct brw_codegen *p,<br>
-                 int dispatch_width,<br>
                   struct brw_reg payload,<br>
                   struct brw_reg implied_header,<br>
                   unsigned msg_control,<br>
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c<br>
index 10cbbe8..ff8e207 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c<br>
@@ -2342,7 +2342,6 @@ void brw_oword_block_read(struct brw_codegen *p,<br>
<br>
<br>
 void brw_fb_WRITE(struct brw_codegen *p,<br>
-                 int dispatch_width,<br>
                   struct brw_reg payload,<br>
                   struct brw_reg implied_header,<br>
                   unsigned msg_control,<br>
@@ -2358,7 +2357,7 @@ void brw_fb_WRITE(struct brw_codegen *p,<br>
    unsigned msg_type;<br>
    struct brw_reg dest, src0;<br>
<br>
-   if (dispatch_width == 16)<br>
+   if (brw_inst_exec_size(devinfo, p->current) >= BRW_EXECUTE_16)<br>
       dest = retype(vec16(brw_null_reg()), BRW_REGISTER_TYPE_UW);<br>
    else<br>
       dest = retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW);<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp<br>
index 71ac730..9751926 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp<br>
@@ -229,7 +229,6 @@ fs_generator::fire_fb_write(fs_inst *inst,<br>
<br>
<br>
    brw_fb_WRITE(p,<br>
-                dispatch_width,<br>
                 payload,<br>
                 implied_header,<br>
                 msg_control,<br>
@@ -547,7 +546,7 @@ fs_generator::generate_linterp(fs_inst *inst,<br>
     * See also: emit_interpolation_setup_gen4().<br>
     */<br>
    struct brw_reg delta_x = src[0];<br>
-   struct brw_reg delta_y = offset(src[0], dispatch_width / 8);<br>
+   struct brw_reg delta_y = offset(src[0], inst->exec_size / 8);<br>
    struct brw_reg interp = src[1];<br>
<br>
    if (devinfo->has_pln &&<br>
@@ -1206,10 +1205,11 @@ fs_generator::generate_varying_pull_constant_load_gen4(fs_inst *inst,<br>
    uint32_t surf_index = index.ud;<br>
<br>
    uint32_t simd_mode, rlen, msg_type;<br>
-   if (dispatch_width == 16) {<br>
+   if (inst->exec_size == 16) {<br>
       simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD16;<br>
       rlen = 8;<br>
    } else {<br>
+      assert(inst->exec_size == 8);<br>
       simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD8;<br>
       rlen = 4;<br>
    }<br>
@@ -1267,11 +1267,12 @@ fs_generator::generate_varying_pull_constant_load_gen7(fs_inst *inst,<br>
    assert(index.type == BRW_REGISTER_TYPE_UD);<br>
<br>
    uint32_t simd_mode, rlen, mlen;<br>
-   if (dispatch_width == 16) {<br>
+   if (inst->exec_size == 16) {<br>
       mlen = 2;<br>
       rlen = 8;<br>
       simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD16;<br>
    } else {<br>
+      assert(inst->exec_size == 8);<br>
       mlen = 1;<br>
       rlen = 4;<br>
       simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD8;<br>
@@ -1407,9 +1408,9 @@ fs_generator::generate_set_sample_id(fs_inst *inst,<br>
           src0.type == BRW_REGISTER_TYPE_UD);<br>
<br>
    struct brw_reg reg = stride(src1, 1, 4, 0);<br>
-   if (devinfo->gen >= 8 || dispatch_width == 8) {<br>
+   if (devinfo->gen >= 8 || inst->exec_size == 8) {<br>
       brw_ADD(p, dst, src0, reg);<br>
-   } else if (dispatch_width == 16) {<br>
+   } else if (inst->exec_size == 16) {<br>
       brw_push_insn_state(p);<br>
       brw_set_default_exec_size(p, BRW_EXECUTE_8);<br>
       brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.3<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>