mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
nv50/ir/nir: ignore sampler for TXF/TXQ ops.
Recently, a regression was reported where videos in Firefox had shifted/ glitched colors on certain Kepler hardware. This was bisected tobf02bffe15, however, the issue already existed but didn't hit users until TGSI was switched to NIR as default. The issue was traced to a YUV-to-RGB fragment shader used by Firefox, which uses three samplers for the Y/U/V components. The Y component was handled correctly, but the U/V components were bogus, causing the issue. After analysis, it appears the TXF/TXQ ops. should only handle the texture (r) but not the sampler (s), see63b850403cand346ce0b988. Similarly, handleTXQ/handleTXF on nv50_ir_from_tgsi always sets s=0. Only Kepler was affected because other hardware ignores s at codegen. Always set s=0 on NIR for TXF/TXQ, to keep TGSI behavior and fix the regression. Thanks: Karol Herbst and M Henning for help diagnosing the issue. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7416 Cc: mesa-stable Suggested-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: M Henning <drawoc@darkrefraction.com> Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19453> (cherry picked from commit6014a642ae)
This commit is contained in:
parent
7e7d1bd6ee
commit
df8d107ab0
2 changed files with 3 additions and 1 deletions
|
|
@ -202,7 +202,7 @@
|
|||
"description": "nv50/ir/nir: ignore sampler for TXF/TXQ ops.",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3067,6 +3067,8 @@ Converter::visit(nir_tex_instr *insn)
|
|||
|
||||
r = bindless ? 0xff : insn->texture_index;
|
||||
s = bindless ? 0x1f : insn->sampler_index;
|
||||
if (op == OP_TXF || op == OP_TXQ)
|
||||
s = 0;
|
||||
|
||||
defs.resize(newDefs.size());
|
||||
for (uint8_t d = 0u; d < newDefs.size(); ++d) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue