llvmpipe: Initialize src array in generate_fs_twiddle

Fixes a -Wmaybe-uninitialized warning:

../src/gallium/drivers/llvmpipe/lp_state_fs.c: In function 'generate_fs_twiddle':
../src/gallium/drivers/llvmpipe/lp_state_fs.c:1555:7: error: 'src' may be used uninitialized [-Werror=maybe-uninitialized]
 1555 |       lp_bld_quad_twiddle(gallivm, type, src, src_count, dst);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/gallium/drivers/llvmpipe/lp_state_fs.c:89:
../src/gallium/auxiliary/gallivm/lp_bld_quad.h:95:1: note: by argument 3 of type 'struct LLVMOpaqueValue * const*' to 'lp_bld_quad_twiddle' declared here
   95 | lp_bld_quad_twiddle(struct gallivm_state *gallivm,
      | ^~~~~~~~~~~~~~~~~~~
../src/gallium/drivers/llvmpipe/lp_state_fs.c:1474:17: note: 'src' declared here
 1474 |    LLVMValueRef src[16];
      |

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35853>
This commit is contained in:
Valentine Burley 2025-05-15 13:46:09 +02:00 committed by Marge Bot
parent ac11e00b15
commit 98736e55e0

View file

@ -1473,7 +1473,7 @@ generate_fs_twiddle(struct gallivm_state *gallivm,
LLVMValueRef* dst,
bool pad_inline)
{
LLVMValueRef src[16];
LLVMValueRef src[16] = { 0 };
unsigned pixels = type.length / 4;
unsigned src_channels = dst_channels < 3 ? dst_channels : 4;
unsigned src_count = num_fs * src_channels;