retype(dispatch_mask, BRW_REGISTER_TYPE_UW));
}
- /* Generate FS IR for main(). (the visitor only descends into
- * functions called "main").
- */
emit_nir_code();
if (failed)
nir_setup_uniforms();
nir_emit_system_values();
- /* get the main function and emit it */
- nir_foreach_function(function, nir) {
- assert(strcmp(function->name, "main") == 0);
- assert(function->impl);
- nir_emit_impl(function->impl);
- }
+ nir_emit_impl(nir_shader_get_entrypoint((nir_shader *)nir));
}
void
}
}
- nir_foreach_function(function, nir) {
- assert(strcmp(function->name, "main") == 0);
- assert(function->impl);
- nir_foreach_block(block, function->impl) {
- emit_system_values_block(block, this);
- }
- }
+ nir_function_impl *impl = nir_shader_get_entrypoint((nir_shader *)nir);
+ nir_foreach_block(block, impl)
+ emit_system_values_block(block, this);
}
/*
if (nir->num_uniforms > 0)
nir_setup_uniforms();
- /* get the main function and emit it */
- nir_foreach_function(function, nir) {
- assert(strcmp(function->name, "main") == 0);
- assert(function->impl);
- nir_emit_impl(function->impl);
- }
+ nir_emit_impl(nir_shader_get_entrypoint((nir_shader *)nir));
}
void
exec_node_remove(&func->node);
}
assert(exec_list_length(&nir->functions) == 1);
- entry_point->name = ralloc_strdup(entry_point, "main");
/* Now that we've deleted all but the main function, we can go ahead and
* lower the rest of the constant initializers. We do this here so that