summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-07-31 10:31:50 -0400
committerEric Engestrom <eric@engestrom.ch>2020-08-05 22:23:21 +0200
commit3be7fca3ee2662599f7bf3205f88bc3114727a32 (patch)
tree88f507cfbab2afee2274ca041fb72116743f966f /src
parent440275b3e25c3a4e9e3c4b70196c46941a72eba5 (diff)
pan/mdg: Mask spills from texture write
This prevents RA failures the results of reading multiple textures that require less than 4 channels, as seen in a number of GL 3 WebRender shaders. Closes: #3342 Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reported-by: Icecream95 <ixn@keemail.me> Tested-by: Icecream95 <ixn@keemail.me> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6144> (cherry picked from commit b4de9e035ac0afe64ebfd58cd0eb04c1a671afce)
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/midgard/midgard_ra.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/panfrost/midgard/midgard_ra.c b/src/panfrost/midgard/midgard_ra.c
index 6049efc3f8f..c545bed5e17 100644
--- a/src/panfrost/midgard/midgard_ra.c
+++ b/src/panfrost/midgard/midgard_ra.c
@@ -835,9 +835,17 @@ mir_spill_register(
midgard_instruction st;
+ /* Note: it's important to match the mask of the spill
+ * with the mask of the instruction whose destination
+ * we're spilling, or otherwise we'll read invalid
+ * components and can fail RA in a subsequent iteration
+ */
+
if (is_special_w) {
st = v_mov(spill_node, spill_slot);
st.no_spill |= (1 << spill_class);
+ st.mask = ins->mask;
+ st.dest_type = st.src_types[0] = ins->dest_type;
} else {
ins->dest = spill_index++;
ins->no_spill |= (1 << spill_class);