1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

[dxbc] Implement EmitThenCut / EmitThenCutStream

This commit is contained in:
Philip Rebohle 2018-06-23 17:34:50 +02:00
parent 07ef25fec5
commit dd51437584
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 16 additions and 20 deletions

View File

@ -1994,25 +1994,19 @@ namespace dxvk {
void DxbcCompiler::emitGeometryEmit(const DxbcShaderInstruction& ins) { void DxbcCompiler::emitGeometryEmit(const DxbcShaderInstruction& ins) {
switch (ins.op) { // Checking the negation is easier for EmitThenCut/EmitThenCutStream
case DxbcOpcode::Emit: bool doEmit = ins.op != DxbcOpcode::Cut && ins.op != DxbcOpcode::CutStream;
case DxbcOpcode::EmitStream: { bool doCut = ins.op != DxbcOpcode::Emit && ins.op != DxbcOpcode::EmitStream;
if (doEmit) {
emitOutputSetup(); emitOutputSetup();
emitClipCullStore(DxbcSystemValue::ClipDistance, m_clipDistances); emitClipCullStore(DxbcSystemValue::ClipDistance, m_clipDistances);
emitClipCullStore(DxbcSystemValue::CullDistance, m_cullDistances); emitClipCullStore(DxbcSystemValue::CullDistance, m_cullDistances);
m_module.opEmitVertex(); m_module.opEmitVertex();
} break;
case DxbcOpcode::Cut:
case DxbcOpcode::CutStream: {
m_module.opEndPrimitive();
} break;
default:
Logger::warn(str::format(
"DxbcCompiler: Unhandled instruction: ",
ins.op));
} }
if (doCut)
m_module.opEndPrimitive();
} }

View File

@ -87,7 +87,7 @@ namespace dxvk {
/* Emit */ /* Emit */
{ 0, DxbcInstClass::GeometryEmit }, { 0, DxbcInstClass::GeometryEmit },
/* EmitThenCut */ /* EmitThenCut */
{ }, { 0, DxbcInstClass::GeometryEmit },
/* EndIf */ /* EndIf */
{ 0, DxbcInstClass::ControlFlow }, { 0, DxbcInstClass::ControlFlow },
/* EndLoop */ /* EndLoop */
@ -582,7 +582,9 @@ namespace dxvk {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 }, { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },
} }, } },
/* EmitThenCutStream */ /* EmitThenCutStream */
{ }, { 1, DxbcInstClass::GeometryEmit, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },
} },
/* InterfaceCall */ /* InterfaceCall */
{ }, { },
/* BufInfo */ /* BufInfo */