From 2483d28d0b68f211a032f4c942a17d907ce7266f Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Mon, 6 Jan 2025 21:56:27 +0100 Subject: [PATCH] etnaviv: clean up component use setting in linker Use a trivial loop instead of duplicating the code for each component. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c index 7a45c79fccc..5ac9653bf97 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c @@ -1397,10 +1397,8 @@ etna_link_shader(struct etna_shader_link_info *info, else /* texture coord or other bypasses flat shading */ varying->pa_attributes = 0x2f1; - varying->use[0] = VARYING_COMPONENT_USE_GENERIC; - varying->use[1] = VARYING_COMPONENT_USE_GENERIC; - varying->use[2] = VARYING_COMPONENT_USE_GENERIC; - varying->use[3] = VARYING_COMPONENT_USE_GENERIC; + for (int i = 0; i < 4; i++) + varying->use[i] = VARYING_COMPONENT_USE_GENERIC; /* point/tex coord is an input to the PS without matching VS output, * so it gets a varying slot without being assigned a VS register.