From 3531c1e3157e1c6936ca9fdbfeba871e3fdb1635 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20=C5=9Alusarz?= Date: Mon, 18 Jul 2022 18:36:19 +0200 Subject: [PATCH] nir/lower_task_shader: print shader after each step MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Timur Kristóf Reviewed-by: Caio Oliveira Part-of: --- src/amd/common/ac_nir_lower_taskmesh_io_to_mem.c | 2 +- src/compiler/nir/nir_lower_task_shader.c | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/amd/common/ac_nir_lower_taskmesh_io_to_mem.c b/src/amd/common/ac_nir_lower_taskmesh_io_to_mem.c index fa4f53b..fbb4a92 100644 --- a/src/amd/common/ac_nir_lower_taskmesh_io_to_mem.c +++ b/src/amd/common/ac_nir_lower_taskmesh_io_to_mem.c @@ -365,7 +365,7 @@ ac_nir_lower_task_outputs_to_mem(nir_shader *shader, nir_lower_task_shader_options lower_ts_opt = { .payload_to_shared_for_atomics = true, }; - NIR_PASS(_, shader, nir_lower_task_shader, lower_ts_opt); + nir_lower_task_shader(shader, lower_ts_opt); lower_tsms_io_state state = { .draw_entry_bytes = 16, diff --git a/src/compiler/nir/nir_lower_task_shader.c b/src/compiler/nir/nir_lower_task_shader.c index 1417cbd..6112a5a 100644 --- a/src/compiler/nir/nir_lower_task_shader.c +++ b/src/compiler/nir/nir_lower_task_shader.c @@ -356,6 +356,13 @@ uses_task_payload_atomics(nir_shader *shader) return false; } +static bool +nir_lower_task_intrins(nir_shader *shader, lower_task_state *state) +{ + return nir_shader_instructions_pass(shader, lower_task_intrin, + nir_metadata_none, state); +} + /** * Common Task Shader lowering to make the job of the backends easier. * @@ -391,7 +398,7 @@ nir_lower_task_shader(nir_shader *shader, * If the shader writes TASK_COUNT, lower that to emit * the new launch_mesh_workgroups intrinsic instead. */ - nir_lower_nv_task_count(shader); + NIR_PASS_V(shader, nir_lower_nv_task_count); } else { /* To make sure that task shaders always have a code path that * executes a launch_mesh_workgroups, let's add one at the end. @@ -414,13 +421,13 @@ nir_lower_task_shader(nir_shader *shader, shader->info.shared_size = state.payload_shared_addr + shader->info.task_payload_size; - nir_shader_instructions_pass(shader, lower_task_intrin, - nir_metadata_none, &state); + NIR_PASS(_, shader, nir_lower_task_intrins, &state); /* Delete all code that potentially can't be reached due to * launch_mesh_workgroups being a terminating instruction. */ - nir_lower_returns(shader); + NIR_PASS(_, shader, nir_lower_returns); + bool progress; do { progress = false; -- 2.7.4