Mesa (master): Revert "i965/fs: Predicate byte scattered writes if needed"

Francisco Jerez currojerez at kemper.freedesktop.org
Fri Mar 2 19:37:30 UTC 2018


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

Author: Francisco Jerez <currojerez at riseup.net>
Date:   Sat Feb 24 16:05:21 2018 -0800

Revert "i965/fs: Predicate byte scattered writes if needed"

This reverts commit a4031bdfa927fb4c3c5d0bdadc70634f3c1a5eac.  It's
redundant with the sample mask predication done at this point by the
common logical send lowering infrastructure, and rather buggy because
it wasn't applying the correct sample mask in shaders using discard,
since the dispatch mask returned by FS_OPCODE_MOV_DISPATCH_TO_FLAGS
doesn't reflect samples discarded by the shader, so it could have led
to data corruption in fragment shader invocations that execute discard
based on a non-dynamically uniform condition.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/intel/compiler/brw_fs_nir.cpp | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 47247875e8..554d61d71a 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -4207,25 +4207,12 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
              * to rely on byte scattered in order to write 16-bit elements.
              * The byte_scattered_write message needs that every written 16-bit
              * type to be aligned 32-bits (stride=2).
-             * Additionally, while on Untyped Surface messages the
-             * bits of the execution mask are ANDed with the corresponding
-             * bits of the Pixel/Sample Mask, that is not the case for byte
-             * scattered writes. That is needed to avoid ssbo stores writing
-             * on helper invocations. So when that can affect, we load the
-             * sample mask, and predicate the send message.
              */
-            brw_predicate pred = BRW_PREDICATE_NONE;
-
-            if (stage == MESA_SHADER_FRAGMENT) {
-               bld.emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS);
-               pred = BRW_PREDICATE_NORMAL;
-            }
-
             emit_byte_scattered_write(bld, surf_index, offset_reg,
                                       write_src,
                                       1 /* dims */, 1,
                                       bit_size,
-                                      pred);
+                                      BRW_PREDICATE_NONE);
          } else {
             assert(num_components * type_size <= 16);
             assert((num_components * type_size) % 4 == 0);




More information about the mesa-commit mailing list