pan/bi: Don't read alpha out of bounds
RT#0 may not have alpha, do something safe instead of risking issues with RA later. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>
This commit is contained in:
committed by
Marge Bot
parent
68539ba5eb
commit
111255512a
@@ -441,6 +441,10 @@ bi_emit_fragment_out(bi_builder *b, nir_intrinsic_instr *instr)
|
||||
(T == nir_type_float32) ? bi_word(rgba, 3) :
|
||||
bi_dontcare();
|
||||
|
||||
/* Don't read out-of-bounds */
|
||||
if (nir_src_num_components(instr->src[0]) < 4)
|
||||
alpha = bi_imm_f32(1.0);
|
||||
|
||||
bi_instr *atest = bi_atest_to(b, bi_register(60),
|
||||
bi_register(60), alpha);
|
||||
b->shader->emitted_atest = true;
|
||||
|
||||
Reference in New Issue
Block a user