Mesa (staging/20.1): intel/fs: Don't copy-propagate stride=0 sources into ddx/ddy

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 2 21:01:57 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 1fcb98ec50683ee5c5b813e40007e4f1a0aca579
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fcb98ec50683ee5c5b813e40007e4f1a0aca579

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Sep  2 10:13:16 2020 -0500

intel/fs: Don't copy-propagate stride=0 sources into ddx/ddy

This can come up if, for instance, the shader does a derivative of a
uniform or flat input.  Ideally, NIR would use divergence analysis to
get rid of the derivative in this case but it doesn't right now.  This
fixes a crash in F1 2017.

Cc: mesa-stable at lists.freedesktop.org
Reported-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6564>
(cherry picked from commit 8e8701b43a0fc1997ecdb6a9557dd3e2c1a0d398)

---

 .pick_status.json                              | 2 +-
 src/intel/compiler/brw_fs_copy_propagation.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 17bfdfc9068..8696d3264d1 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -58,7 +58,7 @@
         "description": "intel/fs: Don't copy-propagate stride=0 sources into ddx/ddy",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp
index a33043573a5..31e55e64a27 100644
--- a/src/intel/compiler/brw_fs_copy_propagation.cpp
+++ b/src/intel/compiler/brw_fs_copy_propagation.cpp
@@ -524,7 +524,7 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
     */
    const unsigned entry_stride = (entry->src.file == FIXED_GRF ? 1 :
                                   entry->src.stride);
-   if (instruction_requires_packed_data(inst) && entry_stride > 1)
+   if (instruction_requires_packed_data(inst) && entry_stride != 1)
       return false;
 
    /* Bail if the result of composing both strides would exceed the



More information about the mesa-commit mailing list