panfrost/lower_framebufffer: Don't use i2imp

Fails when converting from i2i8, which is possible.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
This commit is contained in:
Alyssa Rosenzweig 2021-05-04 11:08:42 -04:00 committed by Marge Bot
parent 03e3e65cd4
commit 30423b0c36
1 changed files with 4 additions and 4 deletions

View File

@ -316,7 +316,7 @@ pan_unpack_unorm_small(nir_builder *b, nir_ssa_def *pack,
nir_ssa_def *scales, nir_ssa_def *shifts)
{
nir_ssa_def *channels = nir_unpack_32_4x8(b, nir_channel(b, pack, 0));
nir_ssa_def *raw = nir_ushr(b, nir_i2imp(b, channels), shifts);
nir_ssa_def *raw = nir_ushr(b, nir_i2i16(b, channels), shifts);
return nir_fmul(b, nir_u2f16(b, raw), scales);
}
@ -403,12 +403,12 @@ pan_unpack_unorm_1010102(nir_builder *b, nir_ssa_def *packed)
{
nir_ssa_def *p = nir_channel(b, packed, 0);
nir_ssa_def *bytes = nir_unpack_32_4x8(b, p);
nir_ssa_def *ubytes = nir_i2imp(b, bytes);
nir_ssa_def *ubytes = nir_i2i16(b, bytes);
nir_ssa_def *shifts = nir_ushr(b, pan_replicate_4(b, nir_channel(b, ubytes, 3)),
nir_imm_ivec4(b, 0, 2, 4, 6));
nir_ssa_def *precision = nir_iand(b, shifts,
nir_i2imp(b, nir_imm_ivec4(b, 0x3, 0x3, 0x3, 0x3)));
nir_i2i16(b, nir_imm_ivec4(b, 0x3, 0x3, 0x3, 0x3)));
nir_ssa_def *top_rgb = nir_ishl(b, nir_channels(b, ubytes, 0x7), nir_imm_int(b, 2));
top_rgb = nir_ior(b, nir_channels(b, precision, 0x7), top_rgb);
@ -450,7 +450,7 @@ pan_unpack_uint_1010102(nir_builder *b, nir_ssa_def *packed)
nir_ssa_def *mask = nir_iand(b, shift,
nir_imm_ivec4(b, 0x3ff, 0x3ff, 0x3ff, 0x3));
return nir_i2imp(b, mask);
return nir_i2i16(b, mask);
}
/* NIR means we can *finally* catch a break */