{
int i, j;
ctx->num_locals = 0;
- nir_foreach_variable(variable, &func->impl->locals) {
+ nir_foreach_function_temp_variable(variable, func->impl) {
unsigned attrib_count = glsl_count_attribute_slots(variable->type, false);
variable->data.driver_location = ctx->num_locals * 4;
variable->data.location_frac = 0;
nir_metadata valid_metadata;
} nir_function_impl;
+#define nir_foreach_function_temp_variable(var, impl) \
+ foreach_list_typed(nir_variable, var, node, &(impl)->locals)
+
+#define nir_foreach_function_temp_variable_safe(var, impl) \
+ foreach_list_typed_safe(nir_variable, var, node, &(impl)->locals)
+
ATTRIBUTE_RETURNS_NONNULL static inline nir_block *
nir_start_block(nir_function_impl *impl)
{
}
struct var_info *var_infos = ralloc_array(NULL, struct var_info, num_locals);
- nir_foreach_variable(var, &impl->locals) {
+ nir_foreach_function_temp_variable(var, impl) {
var_infos[var->index] = (struct var_info) {
.var = var,
.is_constant = true,
fprintf(fp, "{\n");
- nir_foreach_variable(var, &impl->locals) {
+ nir_foreach_function_temp_variable(var, impl) {
fprintf(fp, "\t");
print_var_decl(var, state);
}
state->parent_node = &impl->cf_node;
exec_list_validate(&impl->locals);
- nir_foreach_variable(var, &impl->locals) {
+ nir_foreach_function_temp_variable(var, impl) {
validate_var_decl(var, nir_var_function_temp, state);
}