From 280eb2d689f618864932ac22c83e59422197fab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 30 Oct 2025 17:05:50 +0100 Subject: [PATCH] vulkan/nir: call nir_opt_constant_folding() during vk_spirv_to_nir() This prevents bugged CTS tests from tripping over with the following commits. dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp32.generated_args.denorm_sstep_denorm_flush_to_zero dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.generated_args.denorm_sstep_denorm_flush_to_zero_* These tests exhibit undefined values where the result depends on the ordering of nir_opt_algebraic and nir_opt_constant_folding. Part-of: --- src/vulkan/runtime/vk_nir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vulkan/runtime/vk_nir.c b/src/vulkan/runtime/vk_nir.c index c77784004f2..2e6165df082 100644 --- a/src/vulkan/runtime/vk_nir.c +++ b/src/vulkan/runtime/vk_nir.c @@ -164,6 +164,7 @@ vk_spirv_to_nir(struct vk_device *device, NIR_PASS(_, nir, nir_lower_returns); NIR_PASS(_, nir, nir_inline_functions); NIR_PASS(_, nir, nir_copy_prop); + NIR_PASS(_, nir, nir_opt_constant_folding); NIR_PASS(_, nir, nir_opt_deref); /* Pick off the single entrypoint that we want */