From 87e8b9733fecdca993056512cc3ccbc46138e815 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Mon, 25 May 2020 09:21:30 +0100 Subject: [PATCH] [dxso] Blacklist FETCH4 for cubes and normalize flags --- src/dxso/dxso_compiler.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dxso/dxso_compiler.cpp b/src/dxso/dxso_compiler.cpp index edd5a705..d98c6417 100644 --- a/src/dxso/dxso_compiler.cpp +++ b/src/dxso/dxso_compiler.cpp @@ -2771,7 +2771,7 @@ void DxsoCompiler::emitControlFlowGenericLoop( } uint32_t fetch4 = 0; - if (m_programInfo.type() == DxsoProgramType::PixelShader) { + if (m_programInfo.type() == DxsoProgramType::PixelShader && samplerType != SamplerTypeTextureCube) { fetch4 = m_module.opBitFieldUExtract( m_module.defIntType(32, 0), m_ps.fetch4Spec, m_module.consti32(samplerIdx), m_module.consti32(1)); @@ -3089,7 +3089,12 @@ void DxsoCompiler::emitControlFlowGenericLoop( if (fetch4 && !depthCompare) { - uint32_t fetch4Val = m_module.opImageGather(resultType, sampledImage, coordinates, m_module.consti32(0), operands); + SpirvImageOperands fetch4Operands = operands; + fetch4Operands.flags &= ~spv::ImageOperandsLodMask; + fetch4Operands.flags &= ~spv::ImageOperandsGradMask; + fetch4Operands.flags &= ~spv::ImageOperandsBiasMask; + + uint32_t fetch4Val = m_module.opImageGather(resultType, sampledImage, coordinates, m_module.consti32(0), fetch4Operands); // B R G A swizzle... Funny D3D9 order. const std::array indices = { 2, 0, 1, 3 }; fetch4Val = m_module.opVectorShuffle(resultType, fetch4Val, fetch4Val, indices.size(), indices.data());