1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 19:24:10 +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) {
switch (ins.op) {
case DxbcOpcode::Emit:
case DxbcOpcode::EmitStream: {
// 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();
} 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 */
{ 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 */