[Mesa-dev] [PATCH 3/5] i965: Use nir_foreach_variable

Jason Ekstrand jason at jlekstrand.net
Fri Oct 2 19:48:49 PDT 2015


---
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp       | 6 +++---
 src/mesa/drivers/dri/i965/brw_nir.c            | 2 +-
 src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp | 2 +-
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp     | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 114a017..03fe680 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -58,7 +58,7 @@ fs_visitor::nir_setup_inputs()
 {
    nir_inputs = bld.vgrf(BRW_REGISTER_TYPE_F, nir->num_inputs);
 
-   foreach_list_typed(nir_variable, var, node, &nir->inputs) {
+   nir_foreach_variable(var, &nir->inputs) {
       enum brw_reg_type type = brw_type_for_base_type(var->type);
       fs_reg input = offset(nir_inputs, bld, var->data.driver_location);
 
@@ -122,7 +122,7 @@ fs_visitor::nir_setup_outputs()
 
    nir_outputs = bld.vgrf(BRW_REGISTER_TYPE_F, nir->num_outputs);
 
-   foreach_list_typed(nir_variable, var, node, &nir->outputs) {
+   nir_foreach_variable(var, &nir->outputs) {
       fs_reg reg = offset(nir_outputs, bld, var->data.driver_location);
 
       int vector_elements =
@@ -180,7 +180,7 @@ fs_visitor::nir_setup_uniforms()
 
    uniforms = nir->num_uniforms;
 
-   foreach_list_typed(nir_variable, var, node, &nir->uniforms) {
+   nir_foreach_variable(var, &nir->uniforms) {
       /* UBO's and atomics don't take up space in the uniform file */
       if (var->interface_type != NULL || var->type->contains_atomic())
          continue;
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 4f19655..12f47ad 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -40,7 +40,7 @@ brw_nir_lower_outputs(nir_shader *nir, bool is_scalar)
    if (is_scalar) {
       nir_assign_var_locations(&nir->outputs, &nir->num_outputs, type_size_scalar);
    } else {
-      foreach_list_typed(nir_variable, var, node, &nir->outputs)
+      nir_foreach_variable(var, &nir->outputs)
          var->data.driver_location = var->data.location;
    }
 }
diff --git a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
index f19d746..d3326e9 100644
--- a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
+++ b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
@@ -129,7 +129,7 @@ brw_nir_setup_glsl_uniforms(nir_shader *shader,
 {
    unsigned comps_per_unit = is_scalar ? 1 : 4;
 
-   foreach_list_typed(nir_variable, var, node, &shader->uniforms) {
+   nir_foreach_variable(var, &shader->uniforms) {
       /* UBO's, atomics and samplers don't take up space in the
          uniform file */
       if (var->interface_type != NULL || var->type->contains_atomic())
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 8c22f9b..41bd80d 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -119,7 +119,7 @@ vec4_visitor::nir_setup_inputs()
 {
    nir_inputs = ralloc_array(mem_ctx, src_reg, nir->num_inputs);
 
-   foreach_list_typed(nir_variable, var, node, &nir->inputs) {
+   nir_foreach_variable(var, &nir->inputs) {
       int offset = var->data.driver_location;
       unsigned size = type_size_vec4(var->type);
       for (unsigned i = 0; i < size; i++) {
@@ -134,7 +134,7 @@ vec4_visitor::nir_setup_uniforms()
 {
    uniforms = nir->num_uniforms;
 
-   foreach_list_typed(nir_variable, var, node, &nir->uniforms) {
+   nir_foreach_variable(var, &nir->uniforms) {
       /* UBO's and atomics don't take up space in the uniform file */
       if (var->interface_type != NULL || var->type->contains_atomic())
          continue;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list