[dxbc] Fix constant texture offsets with 1D textures

Fixes #3572.
This commit is contained in:
Philip Rebohle 2023-07-22 17:37:37 +02:00
parent 1e11db98d0
commit b4d87eaac0
1 changed files with 21 additions and 9 deletions

View File

@ -3383,10 +3383,14 @@ namespace dxvk {
};
imageOperands.flags |= spv::ImageOperandsConstOffsetMask;
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
// a buffer or from a multisample texture.
@ -3519,10 +3523,14 @@ namespace dxvk {
};
imageOperands.flags |= spv::ImageOperandsConstOffsetMask;
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
// vector, even for the depth-compare variants.
@ -3661,10 +3669,14 @@ namespace dxvk {
};
imageOperands.flags |= spv::ImageOperandsConstOffsetMask;
imageOperands.sConstOffset = offsetIds[0];
if (imageLayerDim > 1) {
imageOperands.sConstOffset = m_module.constComposite(
getVectorTypeId({ DxbcScalarType::Sint32, imageLayerDim }),
imageLayerDim, offsetIds.data());
}
}
if (hasMinLod) {
m_module.enableCapability(spv::CapabilityMinLod);