vc4: Use nir_foreach_variable
authorBoyan Ding <boyan.j.ding@gmail.com>
Fri, 16 Oct 2015 07:15:39 +0000 (15:15 +0800)
committerEric Anholt <eric@anholt.net>
Tue, 20 Oct 2015 08:54:53 +0000 (09:54 +0100)
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/vc4/vc4_nir_lower_blend.c
src/gallium/drivers/vc4/vc4_nir_lower_io.c
src/gallium/drivers/vc4/vc4_program.c

index a842d604a51a04a69fc09fe5379bc6efd9ea666b..17b524653bbfd00d0d91fe6474e39fbf23bb49ec 100644 (file)
@@ -393,7 +393,7 @@ vc4_nir_lower_blend_block(nir_block *block, void *state)
                         continue;
 
                 nir_variable *output_var = NULL;
-                foreach_list_typed(nir_variable, var, node, &c->s->outputs) {
+                nir_foreach_variable(var, &c->s->outputs) {
                         if (var->data.driver_location == intr->const_index[0]) {
                                 output_var = var;
                                 break;
index a98d70da7d8bb3ebcc485be8c60358b118c98a8e..761e2c819c5ba2537058d6a44e8c91573b7f8cd6 100644 (file)
@@ -63,7 +63,7 @@ vc4_nir_lower_input(struct vc4_compile *c, nir_builder *b,
         }
 
         nir_variable *input_var = NULL;
-        foreach_list_typed(nir_variable, var, node, &c->s->inputs) {
+        nir_foreach_variable(var, &c->s->inputs) {
                 if (var->data.driver_location == intr->const_index[0]) {
                         input_var = var;
                         break;
@@ -129,7 +129,7 @@ vc4_nir_lower_output(struct vc4_compile *c, nir_builder *b,
                      nir_intrinsic_instr *intr)
 {
         nir_variable *output_var = NULL;
-        foreach_list_typed(nir_variable, var, node, &c->s->outputs) {
+        nir_foreach_variable(var, &c->s->outputs) {
                 if (var->data.driver_location == intr->const_index[0]) {
                         output_var = var;
                         break;
index 31c7e28ff57e0efa583f655f9012b3fa87ef15e6..1b590a2d0c47e00e92f36b111af6281889c47e90 100644 (file)
@@ -1383,13 +1383,13 @@ static void
 ntq_setup_inputs(struct vc4_compile *c)
 {
         unsigned num_entries = 0;
-        foreach_list_typed(nir_variable, var, node, &c->s->inputs)
+        nir_foreach_variable(var, &c->s->inputs)
                 num_entries++;
 
         nir_variable *vars[num_entries];
 
         unsigned i = 0;
-        foreach_list_typed(nir_variable, var, node, &c->s->inputs)
+        nir_foreach_variable(var, &c->s->inputs)
                 vars[i++] = var;
 
         /* Sort the variables so that we emit the input setup in
@@ -1432,7 +1432,7 @@ ntq_setup_inputs(struct vc4_compile *c)
 static void
 ntq_setup_outputs(struct vc4_compile *c)
 {
-        foreach_list_typed(nir_variable, var, node, &c->s->outputs) {
+        nir_foreach_variable(var, &c->s->outputs) {
                 unsigned array_len = MAX2(glsl_get_length(var->type), 1);
                 unsigned loc = var->data.driver_location * 4;
 
@@ -1471,7 +1471,7 @@ ntq_setup_outputs(struct vc4_compile *c)
 static void
 ntq_setup_uniforms(struct vc4_compile *c)
 {
-        foreach_list_typed(nir_variable, var, node, &c->s->uniforms) {
+        nir_foreach_variable(var, &c->s->uniforms) {
                 unsigned array_len = MAX2(glsl_get_length(var->type), 1);
                 unsigned array_elem_size = 4 * sizeof(float);