mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-11 11:20:41 +01:00
nir/algebraic: eliminate pack+unpack and unpack+pack pairs
A new NIR shader for AMD drivers will need this. Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29233>
This commit is contained in:
parent
681acde6d3
commit
b4bd380704
1 changed files with 10 additions and 0 deletions
|
|
@ -1744,6 +1744,16 @@ optimizations.extend([
|
|||
(('ibfe', a, 0, 16), ('extract_i16', a, 0), '!options->lower_extract_word'),
|
||||
(('ibfe', a, 16, 16), ('extract_i16', a, 1), '!options->lower_extract_word'),
|
||||
|
||||
# Collapse nop packing.
|
||||
(('unpack_32_4x8', ('pack_32_4x8', a)), a),
|
||||
(('unpack_32_2x16', ('pack_32_2x16', a)), a),
|
||||
(('unpack_64_4x16', ('pack_64_4x16', a)), a),
|
||||
(('unpack_64_2x32', ('pack_64_2x32', a)), a),
|
||||
(('pack_32_4x8', ('unpack_32_4x8', a)), a),
|
||||
(('pack_32_2x16', ('unpack_32_2x16', a)), a),
|
||||
(('pack_64_4x16', ('unpack_64_4x16', a)), a),
|
||||
(('pack_64_2x32', ('unpack_64_2x32', a)), a),
|
||||
|
||||
# Packing a u8vec4 to write to an SSBO.
|
||||
(('ior', ('ishl', ('u2u32', 'a@8'), 24), ('ior', ('ishl', ('u2u32', 'b@8'), 16), ('ior', ('ishl', ('u2u32', 'c@8'), 8), ('u2u32', 'd@8')))),
|
||||
('pack_32_4x8', ('vec4', d, c, b, a)), 'options->has_pack_32_4x8'),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue