mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 03:50:13 +01:00
nir/builder: only read meaningful channels in nir_swizzle()
This way the caller doesn't have to initialize all 4 channels when they aren't using them. v2: Fix signed/unsigned comparison warning (Iago) Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
d982922b18
commit
fb93dd7aa8
1 changed files with 1 additions and 1 deletions
|
|
@ -242,7 +242,7 @@ nir_swizzle(nir_builder *build, nir_ssa_def *src, unsigned swiz[4],
|
|||
{
|
||||
nir_alu_src alu_src = { NIR_SRC_INIT };
|
||||
alu_src.src = nir_src_for_ssa(src);
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (unsigned i = 0; i < num_components; i++)
|
||||
alu_src.swizzle[i] = swiz[i];
|
||||
|
||||
return use_fmov ? nir_fmov_alu(build, alu_src, num_components) :
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue