mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 10:10:09 +01:00
nir/pack_bits: handle 8-bit vec8 -> 64-bit
This is a very silly case, but there's no reason not to handle it efficiently, and this implementation is faster than the fallback. Noticed when playing with scratch optimizations. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32322>
This commit is contained in:
parent
4c84321683
commit
96b38119ea
1 changed files with 5 additions and 0 deletions
|
|
@ -1229,6 +1229,11 @@ nir_pack_bits(nir_builder *b, nir_def *src, unsigned dest_bit_size)
|
|||
return nir_pack_64_2x32(b, src);
|
||||
case 16:
|
||||
return nir_pack_64_4x16(b, src);
|
||||
case 8: {
|
||||
nir_def *lo = nir_pack_32_4x8(b, nir_channels(b, src, 0x0f));
|
||||
nir_def *hi = nir_pack_32_4x8(b, nir_channels(b, src, 0xf0));
|
||||
return nir_pack_64_2x32(b, nir_vec2(b, lo, hi));
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue