intel/compiler: Stop assuming the entrypoint is called "main"
This isn't true for Vulkan so we have to whack it to "main" in anv which is silly. Instead of walking the list of functions and asserting that everything is named "main" and hoping there's only one function named "main", just use the nir_shader_get_entrypoint() helper which has better assertions anyway. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -40,12 +40,7 @@ fs_visitor::emit_nir_code()
|
||||
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
|
||||
@@ -267,13 +262,9 @@ fs_visitor::nir_emit_system_values()
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user