summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-08-18 10:56:48 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-08-25 19:18:24 -0700
commit3203fe3d509b6a0e44c82384fba1dcc4c8c43dc6 (patch)
treedf2e4ce0edf30879f31f3ef2d260c6bddb8461fc /src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c
parent93bfa1d7a2e70a72a01c48a04c208845c22f9376 (diff)
downloadexternal_mesa3d-3203fe3d509b6a0e44c82384fba1dcc4c8c43dc6.zip
external_mesa3d-3203fe3d509b6a0e44c82384fba1dcc4c8c43dc6.tar.gz
external_mesa3d-3203fe3d509b6a0e44c82384fba1dcc4c8c43dc6.tar.bz2
nir: Use nir_shader_get_entrypoint in TCS quad workaround code.
We want to insert the code at the end of the program. Looping over all the functions (of which there was only one) was the old way of doing this, but now we have nir_shader_get_entrypoint(), so let's use it. Suggested by Connor Abbott. v2: Update for nir_shader_get_entrypoint API change. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c b/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c
index 0626981..6524b7d 100644
--- a/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c
+++ b/src/mesa/drivers/dri/i965/brw_nir_tcs_workarounds.c
@@ -134,19 +134,16 @@ brw_nir_apply_tcs_quads_workaround(nir_shader *nir)
{
assert(nir->stage == MESA_SHADER_TESS_CTRL);
- nir_foreach_function(func, nir) {
- if (!func->impl)
- continue;
+ nir_function_impl *impl = nir_shader_get_entrypoint(nir);
- nir_builder b;
- nir_builder_init(&b, func->impl);
+ nir_builder b;
+ nir_builder_init(&b, impl);
- struct set_entry *entry;
- set_foreach(func->impl->end_block->predecessors, entry) {
- nir_block *pred = (nir_block *) entry->key;
- emit_quads_workaround(&b, pred);
- }
-
- nir_metadata_preserve(func->impl, 0);
+ struct set_entry *entry;
+ set_foreach(impl->end_block->predecessors, entry) {
+ nir_block *pred = (nir_block *) entry->key;
+ emit_quads_workaround(&b, pred);
}
+
+ nir_metadata_preserve(impl, 0);
}