mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 12:28:07 +02:00
nir: Assert that we don't shrink bit-sizes in nir_lower_bit_size()
The idea of this pass is to promote small bit-sizes to larger, supported bit-sizes for certain operations. It doesn't handle emulating large bit-size operations on smaller bit-sizes; passes like nir_lower_int64 and nir_lower_doubles handle that. So, assert that we aren't shrinking the bit-size, as this will almost certainly produce incorrect results. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23123>
This commit is contained in:
parent
a2d384a5c0
commit
462ef200d8
1 changed files with 2 additions and 0 deletions
|
|
@ -33,6 +33,8 @@
|
|||
static nir_ssa_def *convert_to_bit_size(nir_builder *bld, nir_ssa_def *src,
|
||||
nir_alu_type type, unsigned bit_size)
|
||||
{
|
||||
assert(src->bit_size < bit_size);
|
||||
|
||||
/* create b2i32(a) instead of i2i32(b2i8(a))/i2i32(b2i16(a)) */
|
||||
nir_alu_instr *alu = nir_src_as_alu_instr(nir_src_for_ssa(src));
|
||||
if ((type & (nir_type_uint | nir_type_int)) && bit_size == 32 &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue