const struct glsl_type *interface_type;
} nir_variable;
+#define nir_foreach_variable(var, var_list) \
+ foreach_list_typed(nir_variable, var, node, var_list)
+
typedef struct {
struct exec_node node;
return;
/* find clipvertex/position outputs: */
- foreach_list_typed(nir_variable, var, node, &shader->outputs) {
+ nir_foreach_variable(var, &shader->outputs) {
int loc = var->data.driver_location;
/* keep track of last used driver-location.. we'll be
if (!ucp_enables)
return;
- foreach_list_typed(nir_variable, var, node, &shader->inputs) {
+ nir_foreach_variable(var, &shader->inputs) {
int loc = var->data.driver_location;
/* keep track of last used driver-location.. we'll be
{
unsigned location = 0;
- foreach_list_typed(nir_variable, var, node, var_list) {
+ nir_foreach_variable(var, var_list) {
/*
* UBO's have their own address spaces, so don't count them towards the
* number of global uniforms
/* Walk over all of the outputs turn each output into a temporary and
* make a new variable for the actual output.
*/
- foreach_list_typed(nir_variable, var, node, &state.old_outputs) {
+ nir_foreach_variable(var, &state.old_outputs) {
nir_variable *output = ralloc(shader, nir_variable);
memcpy(output, var, sizeof *output);
int maxloc = -1;
/* find color/face inputs: */
- foreach_list_typed(nir_variable, var, node, &state->shader->inputs) {
+ nir_foreach_variable(var, &state->shader->inputs) {
int loc = var->data.driver_location;
/* keep track of last used driver-location.. we'll be
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);
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);
}
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);
}
state->parent_node = &impl->cf_node;
exec_list_validate(&impl->locals);
- foreach_list_typed(nir_variable, var, node, &impl->locals) {
+ nir_foreach_variable(var, &impl->locals) {
validate_var_decl(var, false, state);
}
state.shader = shader;
exec_list_validate(&shader->uniforms);
- foreach_list_typed(nir_variable, var, node, &shader->uniforms) {
+ nir_foreach_variable(var, &shader->uniforms) {
validate_var_decl(var, true, &state);
}
exec_list_validate(&shader->inputs);
- foreach_list_typed(nir_variable, var, node, &shader->inputs) {
+ nir_foreach_variable(var, &shader->inputs) {
validate_var_decl(var, true, &state);
}
exec_list_validate(&shader->outputs);
- foreach_list_typed(nir_variable, var, node, &shader->outputs) {
+ nir_foreach_variable(var, &shader->outputs) {
validate_var_decl(var, true, &state);
}
exec_list_validate(&shader->globals);
- foreach_list_typed(nir_variable, var, node, &shader->globals) {
+ nir_foreach_variable(var, &shader->globals) {
validate_var_decl(var, true, &state);
}
exec_list_validate(&shader->system_values);
- foreach_list_typed(nir_variable, var, node, &shader->system_values) {
+ nir_foreach_variable(var, &shader->system_values) {
validate_var_decl(var, true, &state);
}