summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRhys Perry <pendingchaos02@gmail.com>2021-02-26 16:05:40 +0000
committerDylan Baker <dylan.c.baker@intel.com>2021-03-11 11:48:46 -0800
commitd6a63c09b589176c9128aae0eb673bd79c700bfe (patch)
tree97d70f8fd3cb8a2b49d430e1743109a4ecb58814
parent7b59be1c7095d95e797277afbad4296db6c80f2d (diff)
aco: add missing usable_read2 check
A Hitman 2 shader does: read64(local_invocation_index() * 4 - 4). This was likely emitting a ds_read2_b32 on GFX6. For local_invocation_index()=0, because the first dword was out-of-bounds, the second was likely also considered out-of-bounds (even though it's not, at offset 0). Likely fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/3882 Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Fixes: 57e6886f981 ("aco: refactor load_lds to use new helpers") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9332> (cherry picked from commit 3a72044ece27f6a06d7819bcd6ba3fcc2f786d0c)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/compiler/aco_instruction_selection.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index e684938e7d9..16074e0657b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3154,7 +3154,7 @@
"description": "aco: add missing usable_read2 check",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "57e6886f981ca629a863544df253b9ecb3604eec"
},
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 142c75c2b48..5113d689a37 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -3316,7 +3316,7 @@ Temp lds_load_callback(Builder& bld, const LoadEmitInfo &info,
} else if (bytes_needed >= 8 && align % 8 == 0) {
size = 8;
op = aco_opcode::ds_read_b64;
- } else if (bytes_needed >= 8 && align % 4 == 0 && const_offset % 4 == 0) {
+ } else if (bytes_needed >= 8 && align % 4 == 0 && const_offset % 4 == 0 && usable_read2) {
size = 8;
read2 = true;
op = aco_opcode::ds_read2_b32;