From b163503f7c362a0a2e04b00fc6c71f372ef6dc3d Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 20 Oct 2021 14:02:39 +0200 Subject: [PATCH] [dxso] Respect SM2+ sampler source swizzle. --- src/dxso/dxso_compiler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dxso/dxso_compiler.cpp b/src/dxso/dxso_compiler.cpp index 9756076d..3659e5c1 100644 --- a/src/dxso/dxso_compiler.cpp +++ b/src/dxso/dxso_compiler.cpp @@ -2927,7 +2927,10 @@ void DxsoCompiler::emitControlFlowGenericLoop( } // Apply operand swizzle to the operand value - result = emitRegisterSwizzle(result, IdentitySwizzle, ctx.dst.mask); + if (m_programInfo.majorVersion() >= 2) // SM 2.0+ + result = emitRegisterSwizzle(result, ctx.src[1].swizzle, ctx.dst.mask); + else + result = emitRegisterSwizzle(result, IdentitySwizzle, ctx.dst.mask); if (opcode == DxsoOpcode::TexBemL) { uint32_t float_t = m_module.defFloatType(32);