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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user