aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-26 17:20:51 -0500
committerMarek Olšák <[email protected]>2020-02-27 22:53:12 -0500
commit6d7b076166e6a26f68c33ea75b9f9473fc162738 (patch)
treeb3f93b98b5854049852dab96fc9bafa8cc8af68a
parent0e25746dde6c43cc3ff020f3db56517041915c99 (diff)
nir: fix 5 warnings
Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3970>
-rw-r--r--src/compiler/nir/nir_lower_clip.c2
-rw-r--r--src/compiler/nir_types.cpp2
-rw-r--r--src/compiler/spirv/vtn_glsl450.c2
-rw-r--r--src/gallium/auxiliary/nir/tgsi_to_nir.c2
-rw-r--r--src/mesa/state_tracker/st_nir_lower_builtin.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c
index 0f0d2eb2c73..1e4915e881b 100644
--- a/src/compiler/nir/nir_lower_clip.c
+++ b/src/compiler/nir/nir_lower_clip.c
@@ -466,7 +466,7 @@ bool
nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables,
bool use_clipdist_array)
{
- nir_variable *in[2];
+ nir_variable *in[2] = {0};
int maxloc = -1;
if (!ucp_enables)
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index 807529fb2b8..36720686eb7 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -657,7 +657,7 @@ glsl_get_natural_size_align_bytes(const struct glsl_type *type,
}
case GLSL_TYPE_ARRAY: {
- unsigned elem_size, elem_align;
+ unsigned elem_size = 0, elem_align = 0;
glsl_get_natural_size_align_bytes(type->fields.array,
&elem_size, &elem_align);
*align = elem_align;
diff --git a/src/compiler/spirv/vtn_glsl450.c b/src/compiler/spirv/vtn_glsl450.c
index 2d66512bc42..a074b6f3fb4 100644
--- a/src/compiler/spirv/vtn_glsl450.c
+++ b/src/compiler/spirv/vtn_glsl450.c
@@ -121,7 +121,7 @@ build_mat_subdet(struct nir_builder *b, struct vtn_ssa_value *src,
return nir_channel(b, src->elems[1 - col]->def, 1 - row);
} else {
/* Swizzle to get all but the specified row */
- unsigned swiz[3];
+ unsigned swiz[NIR_MAX_VEC_COMPONENTS] = {0};
for (unsigned j = 0; j < 3; j++)
swiz[j] = j + (j >= row);
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index fe98bcd980d..6ac894c85bb 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -2302,7 +2302,7 @@ static void
ttn_parse_tgsi(struct ttn_compile *c, const void *tgsi_tokens)
{
struct tgsi_parse_context parser;
- int ret;
+ ASSERTED int ret;
ret = tgsi_parse_init(&parser, tgsi_tokens);
assert(ret == TGSI_PARSE_OK);
diff --git a/src/mesa/state_tracker/st_nir_lower_builtin.c b/src/mesa/state_tracker/st_nir_lower_builtin.c
index f6f9bf15278..13425d59619 100644
--- a/src/mesa/state_tracker/st_nir_lower_builtin.c
+++ b/src/mesa/state_tracker/st_nir_lower_builtin.c
@@ -204,7 +204,7 @@ lower_builtin_block(lower_builtin_state *state, nir_block *block)
nir_ssa_def *def = nir_load_var(b, new_var);
/* swizzle the result: */
- unsigned swiz[4];
+ unsigned swiz[NIR_MAX_VEC_COMPONENTS] = {0};
for (unsigned i = 0; i < 4; i++) {
swiz[i] = GET_SWZ(element->swizzle, i);
assert(swiz[i] <= SWIZZLE_W);