[Mesa-dev] [PATCH 19/47] nir/lower_outputs_to_temporaries: fixup for new foreach_block()
Connor Abbott
cwabbott0 at gmail.com
Wed Apr 13 04:34:58 UTC 2016
Signed-off-by: Connor Abbott <cwabbott0 at gmail.com>
---
.../nir/nir_lower_outputs_to_temporaries.c | 28 ++++++++++------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/src/compiler/nir/nir_lower_outputs_to_temporaries.c b/src/compiler/nir/nir_lower_outputs_to_temporaries.c
index 00ac091..53809bc 100644
--- a/src/compiler/nir/nir_lower_outputs_to_temporaries.c
+++ b/src/compiler/nir/nir_lower_outputs_to_temporaries.c
@@ -58,21 +58,6 @@ emit_output_copies(nir_cursor cursor, struct lower_outputs_state *state)
}
}
-static bool
-emit_output_copies_block(nir_block *block, void *state)
-{
- nir_foreach_instr(block, instr) {
- if (instr->type != nir_instr_type_intrinsic)
- continue;
-
- nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
- if (intrin->intrinsic == nir_intrinsic_emit_vertex)
- emit_output_copies(nir_before_instr(&intrin->instr), state);
- }
-
- return true;
-}
-
void
nir_lower_outputs_to_temporaries(nir_shader *shader, nir_function *entrypoint)
{
@@ -116,7 +101,18 @@ nir_lower_outputs_to_temporaries(nir_shader *shader, nir_function *entrypoint)
/* For geometry shaders, we have to emit the output copies right
* before each EmitVertex call.
*/
- nir_foreach_block(function->impl, emit_output_copies_block, &state);
+ nir_foreach_block(function->impl, block) {
+ nir_foreach_instr(block, instr) {
+ if (instr->type != nir_instr_type_intrinsic)
+ continue;
+
+ nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
+ if (intrin->intrinsic == nir_intrinsic_emit_vertex) {
+ emit_output_copies(nir_before_instr(&intrin->instr),
+ &state);
+ }
+ }
+ }
} else if (function == entrypoint) {
/* For all other shader types, we need to do the copies right before
* the jumps to the end block.
--
2.5.0
More information about the mesa-dev
mailing list