From b85673b086a8c22f7ac0cb80544d354e9dd3931c Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 19 Jan 2024 20:26:02 +0000 Subject: [PATCH] radv: do nir_shader_gather_info after radv_nir_lower_rt_abi Fixes compilation of a Doom Eternal shader with PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT. ac_nir_lower_resinfo() was not happening because it is predicated on uses_resource_info_query and no later optimization updated it. Signed-off-by: Rhys Perry Reviewed-by: Friedrich Vock Reviewed-by: Samuel Pitoiset Cc: mesa-stable Part-of: (cherry picked from commit 90939e93f6657e1334a9c5edd05e80344b17ff66) --- .pick_status.json | 2 +- src/amd/vulkan/radv_pipeline_rt.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 4ab605b52cd..d990283ff79 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4,7 +4,7 @@ "description": "radv: do nir_shader_gather_info after radv_nir_lower_rt_abi", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index c7f3047f561..b2f6ccf2a54 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -414,6 +414,10 @@ radv_rt_nir_to_asm(struct radv_device *device, struct vk_pipeline_cache *cache, temp_stage.nir = shaders[i]; radv_nir_lower_rt_abi(temp_stage.nir, pCreateInfo, &temp_stage.args, &stage->info, stack_size, i > 0, device, pipeline, monolithic); + + /* Info might be out-of-date after inlining in radv_nir_lower_rt_abi(). */ + nir_shader_gather_info(temp_stage.nir, nir_shader_get_entrypoint(temp_stage.nir)); + radv_optimize_nir(temp_stage.nir, pipeline_key->optimisations_disabled); radv_postprocess_nir(device, pipeline_key, &temp_stage);