From 57161f516e4557c16e2b31fb5762339f3c541dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Mon, 11 Nov 2024 12:46:53 +0100 Subject: [PATCH] radv: Mark GS copy shaders as internal. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of passing the meta_shader arg. Signed-off-by: Timur Kristóf Reviewed-by: Konstantin Seurer Reviewed-by: Samuel Pitoiset Acked-by: Daniel Schürmann Part-of: --- src/amd/vulkan/radv_pipeline_compute.c | 2 +- src/amd/vulkan/radv_pipeline_graphics.c | 6 ++++-- src/amd/vulkan/radv_pipeline_rt.c | 2 +- src/amd/vulkan/radv_shader.c | 7 +++---- src/amd/vulkan/radv_shader.h | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline_compute.c b/src/amd/vulkan/radv_pipeline_compute.c index 0a950bdec53..23a1acd5789 100644 --- a/src/amd/vulkan/radv_pipeline_compute.c +++ b/src/amd/vulkan/radv_pipeline_compute.c @@ -118,7 +118,7 @@ radv_compile_cs(struct radv_device *device, struct vk_pipeline_cache *cache, str /* Postprocess NIR. */ radv_postprocess_nir(device, NULL, cs_stage); - bool dump_shader = radv_can_dump_shader(device, cs_stage->nir, false); + bool dump_shader = radv_can_dump_shader(device, cs_stage->nir); if (dump_shader) { simple_mtx_lock(&instance->shader_dump_mtx); diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index dfcd3dc0593..6bc0c46f47b 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -2240,6 +2240,8 @@ radv_create_gs_copy_shader(struct radv_device *device, struct vk_pipeline_cache gs_info->outinfo.vs_output_param_offset, gs_info->outinfo.param_exports, false, false, false, gs_info->force_vrs_per_vertex, &output_info); + nir->info.internal = true; + nir_validate_shader(nir, "after ac_nir_create_gs_copy_shader"); nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir)); @@ -2270,7 +2272,7 @@ radv_create_gs_copy_shader(struct radv_device *device, struct vk_pipeline_cache NIR_PASS_V(nir, radv_nir_lower_abi, pdev->info.gfx_level, &gs_copy_stage, gfx_state, pdev->info.address32_hi); struct radv_graphics_pipeline_key key = {0}; - bool dump_shader = radv_can_dump_shader(device, nir, true); + bool dump_shader = radv_can_dump_shader(device, nir); if (dump_shader) simple_mtx_lock(&instance->shader_dump_mtx); @@ -2334,7 +2336,7 @@ radv_graphics_shaders_nir_to_asm(struct radv_device *device, struct vk_pipeline_ int64_t stage_start = os_time_get_nano(); - bool dump_shader = radv_can_dump_shader(device, nir_shaders[0], false); + bool dump_shader = radv_can_dump_shader(device, nir_shaders[0]); if (dump_shader) { simple_mtx_lock(&instance->shader_dump_mtx); diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index 8630ac77fff..79b7139c184 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -434,7 +434,7 @@ radv_rt_nir_to_asm(struct radv_device *device, struct vk_pipeline_cache *cache, radv_gather_unused_args(stage_info, shaders[i]); } - bool dump_shader = radv_can_dump_shader(device, shaders[0], false); + bool dump_shader = radv_can_dump_shader(device, shaders[0]); bool replayable = pipeline->base.base.create_flags & VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR; diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index e9f2b153ebf..dc5e9869de6 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -96,7 +96,7 @@ is_meta_shader(nir_shader *nir) } bool -radv_can_dump_shader(struct radv_device *device, nir_shader *nir, bool meta_shader) +radv_can_dump_shader(struct radv_device *device, nir_shader *nir) { const struct radv_physical_device *pdev = radv_device_physical(device); const struct radv_instance *instance = radv_physical_device_instance(pdev); @@ -104,7 +104,7 @@ radv_can_dump_shader(struct radv_device *device, nir_shader *nir, bool meta_shad if (!(instance->debug_flags & RADV_DEBUG_DUMP_SHADERS)) return false; - if ((is_meta_shader(nir) || meta_shader) && !(instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS)) + if (is_meta_shader(nir) && !(instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS)) return false; return true; @@ -3095,8 +3095,7 @@ radv_shader_nir_to_asm(struct radv_device *device, struct radv_shader_stage *pl_ struct radv_nir_compiler_options options = {0}; radv_fill_nir_compiler_options(&options, device, gfx_state, radv_should_use_wgp_mode(device, stage, info), - radv_can_dump_shader(device, shaders[0], false), keep_shader_info, - keep_statistic_info); + radv_can_dump_shader(device, shaders[0]), keep_shader_info, keep_statistic_info); struct radv_shader_binary *binary = shader_compile(device, shaders, shader_count, stage, info, &pl_stage->args, &pl_stage->key, &options); diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 04badc75deb..e2b1f2531ca 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -605,7 +605,7 @@ unsigned radv_compute_spi_ps_input(const struct radv_physical_device *pdev, const struct radv_graphics_state_key *gfx_state, const struct radv_shader_info *info); -bool radv_can_dump_shader(struct radv_device *device, nir_shader *nir, bool meta_shader); +bool radv_can_dump_shader(struct radv_device *device, nir_shader *nir); bool radv_can_dump_shader_stats(struct radv_device *device, nir_shader *nir);