diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 91858662..272f2a1c 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -1994,25 +1994,19 @@ namespace dxvk { void DxbcCompiler::emitGeometryEmit(const DxbcShaderInstruction& ins) { - switch (ins.op) { - case DxbcOpcode::Emit: - case DxbcOpcode::EmitStream: { - emitOutputSetup(); - emitClipCullStore(DxbcSystemValue::ClipDistance, m_clipDistances); - emitClipCullStore(DxbcSystemValue::CullDistance, m_cullDistances); - m_module.opEmitVertex(); - } break; - - case DxbcOpcode::Cut: - case DxbcOpcode::CutStream: { - m_module.opEndPrimitive(); - } break; - - default: - Logger::warn(str::format( - "DxbcCompiler: Unhandled instruction: ", - ins.op)); + // Checking the negation is easier for EmitThenCut/EmitThenCutStream + bool doEmit = ins.op != DxbcOpcode::Cut && ins.op != DxbcOpcode::CutStream; + bool doCut = ins.op != DxbcOpcode::Emit && ins.op != DxbcOpcode::EmitStream; + + if (doEmit) { + emitOutputSetup(); + emitClipCullStore(DxbcSystemValue::ClipDistance, m_clipDistances); + emitClipCullStore(DxbcSystemValue::CullDistance, m_cullDistances); + m_module.opEmitVertex(); } + + if (doCut) + m_module.opEndPrimitive(); } diff --git a/src/dxbc/dxbc_defs.cpp b/src/dxbc/dxbc_defs.cpp index 6d3ae281..12833021 100644 --- a/src/dxbc/dxbc_defs.cpp +++ b/src/dxbc/dxbc_defs.cpp @@ -87,7 +87,7 @@ namespace dxvk { /* Emit */ { 0, DxbcInstClass::GeometryEmit }, /* EmitThenCut */ - { }, + { 0, DxbcInstClass::GeometryEmit }, /* EndIf */ { 0, DxbcInstClass::ControlFlow }, /* EndLoop */ @@ -582,7 +582,9 @@ namespace dxvk { { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 }, } }, /* EmitThenCutStream */ - { }, + { 1, DxbcInstClass::GeometryEmit, { + { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 }, + } }, /* InterfaceCall */ { }, /* BufInfo */