mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-21 05:20:43 +01:00
ac/nir: Simplify arg unpacking when shift is zero.
This is so we can just use the same function when it's zero. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24005>
This commit is contained in:
parent
dc3bbd351a
commit
a7f2d821ec
1 changed files with 4 additions and 1 deletions
|
|
@ -40,7 +40,10 @@ ac_nir_unpack_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct a
|
|||
unsigned rshift, unsigned bitwidth)
|
||||
{
|
||||
nir_ssa_def *value = ac_nir_load_arg(b, ac_args, arg);
|
||||
return nir_ubfe_imm(b, value, rshift, bitwidth);
|
||||
if (rshift)
|
||||
return nir_ubfe_imm(b, value, rshift, bitwidth);
|
||||
else
|
||||
return nir_iand_imm(b, value, BITFIELD_MASK(bitwidth));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue