[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 496b77e51d
commit 2210489200
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 12 additions and 9 deletions

View File

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