From d12a8e09a855d49e1e475216f26e9a59f8852f56 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 23 Feb 2019 14:33:59 +0100 Subject: [PATCH] [dxbc] Decorate integer fragment shader builtins as flat Fixes yellow tint in Unreal Engine 4 games on RADV and AMDGPU-PRO. --- src/dxbc/dxbc_compiler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 11569842..9b3973a3 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -7098,8 +7098,14 @@ namespace dxvk { const char* name) { const uint32_t varId = emitNewVariable(info); - m_module.decorateBuiltIn(varId, builtIn); m_module.setDebugName(varId, name); + m_module.decorateBuiltIn(varId, builtIn); + + if (m_programInfo.type() == DxbcProgramType::PixelShader + && info.type.ctype != DxbcScalarType::Float32 + && info.type.ctype != DxbcScalarType::Bool + && info.sclass == spv::StorageClassInput) + m_module.decorate(varId, spv::DecorationFlat); m_entryPointInterfaces.push_back(varId); return varId;