From a4378996d94b688e756307e6c3dffe2a91240554 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 4 Feb 2019 13:30:08 +0100 Subject: [PATCH] [dxbc] Reduce length of temporary shader input array to a minimum Fixes severe performance regression with the AMD proprietary driver. --- src/dxbc/dxbc_compiler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index bd3f4a3c..e3f1a5b8 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -6696,7 +6696,10 @@ namespace dxvk { DxbcArrayType info; info.ctype = DxbcScalarType::Float32; info.ccount = 4; - info.alength = DxbcMaxInterfaceRegs; + info.alength = m_isgn != nullptr ? m_isgn->maxRegisterCount() : 0; + + if (info.alength == 0) + return; // Define the array type. This will be two-dimensional // in some shaders, with the outer index representing