[Mesa-dev] [PATCH 1/3] nir: Make nir_lower_io_to_temporaries store an impl internally.
Kenneth Graunke
kenneth at whitecape.org
Thu Aug 25 04:15:22 UTC 2016
This changes the pass internals to work with a nir_function_impl
directly rather than a nir_function. The next patch will change
the API.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
src/compiler/nir/nir_lower_io_to_temporaries.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/compiler/nir/nir_lower_io_to_temporaries.c b/src/compiler/nir/nir_lower_io_to_temporaries.c
index 3153a49..80c352a 100644
--- a/src/compiler/nir/nir_lower_io_to_temporaries.c
+++ b/src/compiler/nir/nir_lower_io_to_temporaries.c
@@ -34,7 +34,7 @@
struct lower_io_state {
nir_shader *shader;
- nir_function *entrypoint;
+ nir_function_impl *entrypoint;
struct exec_list old_outputs;
struct exec_list old_inputs;
};
@@ -78,7 +78,7 @@ emit_output_copies_impl(struct lower_io_state *state, nir_function_impl *impl)
}
}
}
- } else if (impl->function == state->entrypoint) {
+ } else if (impl == state->entrypoint) {
/* For all other shader types, we need to do the copies right before
* the jumps to the end block.
*/
@@ -95,7 +95,7 @@ emit_output_copies_impl(struct lower_io_state *state, nir_function_impl *impl)
static void
emit_input_copies_impl(struct lower_io_state *state, nir_function_impl *impl)
{
- if (impl->function == state->entrypoint) {
+ if (impl == state->entrypoint) {
nir_cursor cursor = nir_before_block(nir_start_block(impl));
emit_copies(cursor, state->shader, &state->old_inputs,
&state->shader->inputs);
@@ -136,7 +136,7 @@ nir_lower_io_to_temporaries(nir_shader *shader, nir_function *entrypoint,
return;
state.shader = shader;
- state.entrypoint = entrypoint;
+ state.entrypoint = entrypoint->impl;
if (inputs)
exec_list_move_nodes_to(&shader->inputs, &state.old_inputs);
--
2.9.3
More information about the mesa-dev
mailing list