From 9a244e8951ca955eba6898b82a6a36d01db0728d Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 4 Jan 2025 17:35:53 +0100 Subject: [PATCH] [dxbc] Use NClamp for tess factors and depth clamp This flushes NaN tess factors to 0, which should match D3D behaviour for both outer and inner tess factors. The legacy code hasn't been touched in 7 years. --- src/dxbc/dxbc_compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 5694978ea..685d3b44b 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -6109,7 +6109,7 @@ namespace dxvk { DxbcRegisterValue value = emitValueLoad(ptr); - value.id = m_module.opFClamp( + value.id = m_module.opNClamp( getVectorTypeId(ptr.type), value.id, m_module.constf32(0.0f), @@ -6566,7 +6566,7 @@ namespace dxvk { } DxbcRegisterValue tessValue = emitRegisterExtract(value, mask); - tessValue.id = m_module.opFClamp(getVectorTypeId(tessValue.type), + tessValue.id = m_module.opNClamp(getVectorTypeId(tessValue.type), tessValue.id, m_module.constf32(0.0f), m_module.constf32(maxTessFactor));