mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 01:38:06 +02:00
pan/bi: Use nir_alu_src_as_uint
Fixes some theoretical issues with swizzle handling. Unsure if this could cause actual end-to-end miscompiles. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22695>
This commit is contained in:
parent
0eb5f8e765
commit
445e2f1620
1 changed files with 3 additions and 3 deletions
|
|
@ -2522,7 +2522,7 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
|
|||
case nir_op_extract_i8: {
|
||||
assert(comps == 1 && "should be scalarized");
|
||||
assert((src_sz == 16 || src_sz == 32) && "should be lowered");
|
||||
unsigned byte = nir_src_as_uint(instr->src[1].src);
|
||||
unsigned byte = nir_alu_src_as_uint(instr->src[1]);
|
||||
|
||||
if (s0.swizzle == BI_SWIZZLE_H11) {
|
||||
assert(byte < 2);
|
||||
|
|
@ -2546,7 +2546,7 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
|
|||
case nir_op_extract_i16: {
|
||||
assert(comps == 1 && "should be scalarized");
|
||||
assert(src_sz == 32 && "should be lowered");
|
||||
unsigned half = nir_src_as_uint(instr->src[1].src);
|
||||
unsigned half = nir_alu_src_as_uint(instr->src[1]);
|
||||
assert(half == 0 || half == 1);
|
||||
|
||||
if (instr->op == nir_op_extract_i16)
|
||||
|
|
@ -2558,7 +2558,7 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
|
|||
|
||||
case nir_op_insert_u16: {
|
||||
assert(comps == 1 && "should be scalarized");
|
||||
unsigned half = nir_src_as_uint(instr->src[1].src);
|
||||
unsigned half = nir_alu_src_as_uint(instr->src[1]);
|
||||
assert(half == 0 || half == 1);
|
||||
|
||||
if (half == 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue