mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
nir/lower_io_to_vector: initialize base
Prevent GCC warning:
```
[230/1401] Compiling C object src/compiler/nir/libnir.a.p/nir_lower_io_to_vector.c.o
In function 'get_flat_type',
inlined from 'create_new_io_vars' at ../src/compiler/nir/nir_lower_io_to_vector.c:300:10:
../src/compiler/nir/nir_lower_io_to_vector.c:208:14: warning: 'base' may be used uninitialized [-Wmaybe-uninitialized]
208 | return glsl_array_type(glsl_vector_type(base, 4), slots, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/compiler/nir/nir_lower_io_to_vector.c: In function 'create_new_io_vars':
../src/compiler/nir/nir_lower_io_to_vector.c:163:24: note: 'base' was declared here
163 | enum glsl_base_type base;
| ^~~~
```
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8957
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22840>
This commit is contained in:
parent
be34257197
commit
1c1855cc00
1 changed files with 1 additions and 1 deletions
|
|
@ -160,7 +160,7 @@ get_flat_type(const nir_shader *shader, nir_variable *old_vars[MAX_SLOTS][4],
|
|||
unsigned todo = 1;
|
||||
unsigned slots = 0;
|
||||
unsigned num_vars = 0;
|
||||
enum glsl_base_type base;
|
||||
enum glsl_base_type base = GLSL_TYPE_ERROR;
|
||||
*num_vertices = 0;
|
||||
*first_var = NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue