From 9c5102e257792160c22e62162079913ca40edef2 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 24 Jul 2019 18:18:20 +0200 Subject: [PATCH] [dxvk] Don't duplicate geometry shader system value outputs Fixes #1121. The basic idea here is that all built-ins that can be written by the GS will be consumed as built-ins by the FS anyway, so we do not need to keep the o# variable around. --- src/dxbc/dxbc_compiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 4b01468d3..d44b176be 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -723,6 +723,12 @@ namespace dxvk { if (m_moduleInfo.xfb != nullptr) info.sclass = spv::StorageClassPrivate; + // In geometry shaders, don't duplicate system value outputs + // to stay within device limits. The pixel shader will read + // all GS system value outputs as system value inputs. + if (m_programInfo.type() == DxbcProgramType::GeometryShader && sv != DxbcSystemValue::None) + info.sclass = spv::StorageClassPrivate; + const uint32_t varId = this->emitNewVariable(info); m_module.setDebugName(varId, str::format("o", regIdx).c_str());