aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/nir/nir_lower_vars_to_ssa.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/nir/nir_lower_vars_to_ssa.c')
-rw-r--r--mesalib/src/glsl/nir/nir_lower_vars_to_ssa.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mesalib/src/glsl/nir/nir_lower_vars_to_ssa.c b/mesalib/src/glsl/nir/nir_lower_vars_to_ssa.c
index 8af753029..9e9a418e3 100644
--- a/mesalib/src/glsl/nir/nir_lower_vars_to_ssa.c
+++ b/mesalib/src/glsl/nir/nir_lower_vars_to_ssa.c
@@ -26,6 +26,8 @@
*/
#include "nir.h"
+#include "nir_vla.h"
+
struct deref_node {
struct deref_node *parent;
@@ -899,8 +901,8 @@ rename_variables_block(nir_block *block, struct lower_variables_state *state)
static void
insert_phi_nodes(struct lower_variables_state *state)
{
- unsigned work[state->impl->num_blocks];
- unsigned has_already[state->impl->num_blocks];
+ NIR_VLA_ZERO(unsigned, work, state->impl->num_blocks);
+ NIR_VLA_ZERO(unsigned, has_already, state->impl->num_blocks);
/*
* Since the work flags already prevent us from inserting a node that has
@@ -910,10 +912,7 @@ insert_phi_nodes(struct lower_variables_state *state)
* function. So all we need to handle W is an array and a pointer to the
* next element to be inserted and the next element to be removed.
*/
- nir_block *W[state->impl->num_blocks];
-
- memset(work, 0, sizeof work);
- memset(has_already, 0, sizeof has_already);
+ NIR_VLA(nir_block *, W, state->impl->num_blocks);
unsigned w_start, w_end;
unsigned iter_count = 0;