From 50c6974f3aa4406e9d485834ccd3e2c9fb7cd6fe Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 23 Aug 2021 14:01:46 +0200 Subject: [PATCH] [dxso] Fix gradient instructions for cube maps We need 3 components in that case. Based on MSDN documentation, texldd does not support 3D textures so there's no need to worry about those. Fixes validation errors in Payday. --- src/dxso/dxso_compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dxso/dxso_compiler.cpp b/src/dxso/dxso_compiler.cpp index bb878dc44..8ba8283c5 100644 --- a/src/dxso/dxso_compiler.cpp +++ b/src/dxso/dxso_compiler.cpp @@ -2732,7 +2732,7 @@ void DxsoCompiler::emitControlFlowGenericLoop( } if (opcode == DxsoOpcode::TexLdd) { - DxsoRegMask gradMask(true, true, false, false); + DxsoRegMask gradMask(true, true, sampler.dimensions == 3, false); imageOperands.flags |= spv::ImageOperandsGradMask; imageOperands.sGradX = emitRegisterLoad(ctx.src[2], gradMask).id; imageOperands.sGradY = emitRegisterLoad(ctx.src[3], gradMask).id;