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 b4de9e035a)
This commit is contained in:
Alyssa Rosenzweig 2020-07-31 10:31:50 -04:00 committed by Eric Engestrom
parent 440275b3e2
commit 3be7fca3ee
2 changed files with 9 additions and 1 deletions

View file

@ -913,7 +913,7 @@
"description": "pan/mdg: Mask spills from texture write",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -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);