From 14fa874afb26a870fe3a616843fee0e5736452a9 Mon Sep 17 00:00:00 2001 From: esullivan Date: Thu, 2 Jan 2025 14:51:27 -0800 Subject: [PATCH] [spirv] Emit the grad and const offset image ops in the correct order Currently the grad and const offset image operand ids are emitted in the incorrect order. This causes incorrect code gen if both the grad and const offset image operands are used. This fixes the compilation error found when running TopSpin 2k25 through DXVK using the NVIDIA proprietary Vulkan driver. --- src/spirv/spirv_module.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/spirv/spirv_module.cpp b/src/spirv/spirv_module.cpp index 288a7ac5eab..9d1c74cdba2 100644 --- a/src/spirv/spirv_module.cpp +++ b/src/spirv/spirv_module.cpp @@ -3892,15 +3892,15 @@ namespace dxvk { if (op.flags & spv::ImageOperandsLodMask) m_code.putWord(op.sLod); - - if (op.flags & spv::ImageOperandsConstOffsetMask) - m_code.putWord(op.sConstOffset); - + if (op.flags & spv::ImageOperandsGradMask) { m_code.putWord(op.sGradX); m_code.putWord(op.sGradY); } - + + if (op.flags & spv::ImageOperandsConstOffsetMask) + m_code.putWord(op.sConstOffset); + if (op.flags & spv::ImageOperandsOffsetMask) m_code.putWord(op.gOffset);