i965: Use nir_foreach_variable
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 3 Oct 2015 01:16:10 +0000 (18:16 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 3 Oct 2015 04:21:18 +0000 (21:21 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_nir.c
src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index 114a017a4059d297171fccb46d7941f282624409..03fe680470100dd731d7e0ecac1746ea2a9c0604 100644 (file)
@@ -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;
index 4f1965503eefb6ee0a6d3ea642063a953ccee3eb..12f47ad0dedb64a6740770886b465663e4b73147 100644 (file)
@@ -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;
    }
 }
index f19d74610a191a9ad9ee60d43707de49cc3db3ce..d3326e9fb86120b29dbfde9b4707e8026f2f115d 100644 (file)
@@ -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())
index 8c22f9bed4c29edf3f39db114dcb40a9a567af13..41bd80df37701e073ea2c1e253345cfe90438c60 100644 (file)
@@ -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;