diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 7a97fd57..4b4d71cf 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -3383,9 +3383,13 @@ namespace dxvk { }; imageOperands.flags |= spv::ImageOperandsConstOffsetMask; - imageOperands.sConstOffset = m_module.constComposite( - getVectorTypeId({ DxbcScalarType::Sint32, imageLayerDim }), - imageLayerDim, offsetIds.data()); + imageOperands.sConstOffset = offsetIds[0]; + + if (imageLayerDim > 1) { + imageOperands.sConstOffset = m_module.constComposite( + getVectorTypeId({ DxbcScalarType::Sint32, imageLayerDim }), + imageLayerDim, offsetIds.data()); + } } // The LOD is not present when reading from @@ -3519,9 +3523,13 @@ namespace dxvk { }; imageOperands.flags |= spv::ImageOperandsConstOffsetMask; - imageOperands.sConstOffset = m_module.constComposite( - getVectorTypeId({ DxbcScalarType::Sint32, imageLayerDim }), - imageLayerDim, offsetIds.data()); + imageOperands.sConstOffset = offsetIds[0]; + + if (imageLayerDim > 1) { + imageOperands.sConstOffset = m_module.constComposite( + getVectorTypeId({ DxbcScalarType::Sint32, imageLayerDim }), + imageLayerDim, offsetIds.data()); + } } // Gathering texels always returns a four-component @@ -3661,9 +3669,13 @@ namespace dxvk { }; imageOperands.flags |= spv::ImageOperandsConstOffsetMask; - imageOperands.sConstOffset = m_module.constComposite( - getVectorTypeId({ DxbcScalarType::Sint32, imageLayerDim }), - imageLayerDim, offsetIds.data()); + imageOperands.sConstOffset = offsetIds[0]; + + if (imageLayerDim > 1) { + imageOperands.sConstOffset = m_module.constComposite( + getVectorTypeId({ DxbcScalarType::Sint32, imageLayerDim }), + imageLayerDim, offsetIds.data()); + } } if (hasMinLod) {