Skip to content

Commit

Permalink
[spirv] Emit the grad and const offset image ops in the correct order
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
esullivan-nvidia authored and doitsujin committed Jan 3, 2025
1 parent 8b9b46d commit 33498eb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/spirv/spirv_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 33498eb

Please # to comment.