Commit 1cdd55a8 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜 Committed by Marge Bot
Browse files

pan/bi: Fix CONVERT component counting


Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <mesa/mesa!5260>
parent d8c6a718
......@@ -105,7 +105,16 @@ bi_get_component_count(bi_instruction *ins, signed src)
assert(ins->vector_channels);
return (src <= 0) ? ins->vector_channels : 1;
} else {
unsigned bytes = nir_alu_type_get_type_size(src < 0 ? ins->dest_type : ins->src_types[src]);
unsigned dest_bytes = nir_alu_type_get_type_size(ins->dest_type);
unsigned src_bytes = nir_alu_type_get_type_size(ins->src_types[src]);
/* If there's either f32 on either end, it's only a single
* component, etc. */
unsigned bytes = src < 0 ? dest_bytes : src_bytes;
if (ins->type == BI_CONVERT)
bytes = MAX2(dest_bytes, src_bytes);
if (ins->type == BI_ATEST || ins->type == BI_SELECT)
return 1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment