nir: Add nir_alu_src_as_uint helper
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 25 Apr 2023 18:39:23 +0000 (14:39 -0400)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 11 May 2023 13:23:04 +0000 (09:23 -0400)
commit0eb5f8e76548e05287d195199705b2d259d51609
tree1dfdacc87e9d363606d8adc314667bdeb461c2e1
parent73814050959ee5127328865e64c2faa5401daba2
nir: Add nir_alu_src_as_uint helper

We have a few ALU instructions that take a constant source. Technically, they
have a swizzle so you can't just nir_src_as_uint them, even though a bunch of
backends do. To help backends do the right thing, add a helper that's just as
easy to use that will chase the swizzle properly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22695>
src/compiler/nir/nir.h