1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxbc] Do not emit GS system values if rasterization is disabled

Fixes issue in Star Citizen, which declares a max output vertex count
of 128 in a geometry shader which emits eight components per vertex,
which becomes 12 components in DXVK due to the gl_Position builtin.
This should keep us below the magic limit of 1024 output components.
This commit is contained in:
Philip Rebohle 2019-04-15 03:11:39 +02:00
parent f9e56c97cf
commit 35a2a02714
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -2196,6 +2196,7 @@ namespace dxvk {
bool doCut = ins.op != DxbcOpcode::Emit && ins.op != DxbcOpcode::EmitStream; bool doCut = ins.op != DxbcOpcode::Emit && ins.op != DxbcOpcode::EmitStream;
if (doEmit) { if (doEmit) {
if (m_perVertexOut)
emitOutputSetup(); emitOutputSetup();
emitClipCullStore(DxbcSystemValue::ClipDistance, m_clipDistances); emitClipCullStore(DxbcSystemValue::ClipDistance, m_clipDistances);
emitClipCullStore(DxbcSystemValue::CullDistance, m_cullDistances); emitClipCullStore(DxbcSystemValue::CullDistance, m_cullDistances);
@ -6427,6 +6428,7 @@ namespace dxvk {
// Declare the per-vertex output block. Outputs are not // Declare the per-vertex output block. Outputs are not
// declared as arrays, instead they will be flushed when // declared as arrays, instead they will be flushed when
// calling EmitVertex. // calling EmitVertex.
if (!m_moduleInfo.xfb || m_moduleInfo.xfb->rasterizedStream >= 0) {
const uint32_t perVertexStruct = this->getPerVertexBlockId(); const uint32_t perVertexStruct = this->getPerVertexBlockId();
const uint32_t perVertexPointer = m_module.defPointerType( const uint32_t perVertexPointer = m_module.defPointerType(
perVertexStruct, spv::StorageClassOutput); perVertexStruct, spv::StorageClassOutput);
@ -6435,6 +6437,7 @@ namespace dxvk {
perVertexPointer, spv::StorageClassOutput); perVertexPointer, spv::StorageClassOutput);
m_entryPointInterfaces.push_back(m_perVertexOut); m_entryPointInterfaces.push_back(m_perVertexOut);
m_module.setDebugName(m_perVertexOut, "gs_vertex_out"); m_module.setDebugName(m_perVertexOut, "gs_vertex_out");
}
// Cull/clip distances as outputs // Cull/clip distances as outputs
m_clipDistances = emitDclClipCullDistanceArray( m_clipDistances = emitDclClipCullDistanceArray(