summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_print.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-10-02 18:15:06 -0700
committerJason Ekstrand <[email protected]>2015-10-02 21:21:16 -0700
commit050e4787d3526b8341dd76b59442356f9737ee96 (patch)
tree745536973c0279b53d8d23253b59b28630fc7f4e /src/glsl/nir/nir_print.c
parentca941799ce76eac8afe2503fbacffee057e949d3 (diff)
nir: Add a nir_foreach_variable macro
This is a common enough operation that it's nice to not have to think about the arguments to foreach_list_typed every time. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_print.c')
-rw-r--r--src/glsl/nir/nir_print.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
index a19aa8b9132..3936bae078b 100644
--- a/src/glsl/nir/nir_print.c
+++ b/src/glsl/nir/nir_print.c
@@ -453,7 +453,7 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
return;
}
- foreach_list_typed(nir_variable, var, node, var_list) {
+ nir_foreach_variable(var, var_list) {
if ((var->data.driver_location == instr->const_index[0]) &&
var->name) {
fprintf(fp, "\t/* %s */", var->name);
@@ -872,7 +872,7 @@ print_function_impl(nir_function_impl *impl, print_state *state)
fprintf(fp, "{\n");
- foreach_list_typed(nir_variable, var, node, &impl->locals) {
+ nir_foreach_variable(var, &impl->locals) {
fprintf(fp, "\t");
print_var_decl(var, state);
}
@@ -970,23 +970,23 @@ nir_print_shader(nir_shader *shader, FILE *fp)
fprintf(fp, "shader: %s\n", gl_shader_stage_name(shader->stage));
- foreach_list_typed(nir_variable, var, node, &shader->uniforms) {
+ nir_foreach_variable(var, &shader->uniforms) {
print_var_decl(var, &state);
}
- foreach_list_typed(nir_variable, var, node, &shader->inputs) {
+ nir_foreach_variable(var, &shader->inputs) {
print_var_decl(var, &state);
}
- foreach_list_typed(nir_variable, var, node, &shader->outputs) {
+ nir_foreach_variable(var, &shader->outputs) {
print_var_decl(var, &state);
}
- foreach_list_typed(nir_variable, var, node, &shader->globals) {
+ nir_foreach_variable(var, &shader->globals) {
print_var_decl(var, &state);
}
- foreach_list_typed(nir_variable, var, node, &shader->system_values) {
+ nir_foreach_variable(var, &shader->system_values) {
print_var_decl(var, &state);
}