[dxbc] Do not set ImageOperandsLodMask for multisample loads

This should fix invalid SPIR-V being generated in The Witness.
This commit is contained in:
Philip Rebohle 2018-01-19 09:09:38 +01:00
parent 3bb7b45c33
commit aa02612b9e
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 5 additions and 4 deletions

View File

@ -2327,8 +2327,9 @@ namespace dxvk {
imageLayerDim, offsetIds.data());
}
// The LOD is not present when reading from a buffer
if (imageType.dim != spv::DimBuffer) {
// The LOD is not present when reading from
// a buffer or from a multisample texture.
if (imageType.dim != spv::DimBuffer && imageType.ms == 0) {
DxbcRegisterValue imageLod = emitRegisterExtract(
address, DxbcRegMask(false, false, false, true));
@ -2336,8 +2337,8 @@ namespace dxvk {
imageOperands.sLod = imageLod.id;
}
// The ld2ms instruction also has a sample index, but
// we are only allowed to set it for multisample views
// The ld2ms instruction has a sample index, but we
// are only allowed to set it for multisample views
if (ins.op == DxbcOpcode::LdMs && imageType.ms == 1) {
DxbcRegisterValue sampleId = emitRegisterLoad(
ins.src[2], DxbcRegMask(true, false, false, false));