diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index e0e1384e..f8ca4e07 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -254,6 +254,12 @@ namespace dxvk { case DxbcOpcode::DclMaxOutputVertexCount: return this->emitDclMaxOutputVertexCount(ins); + case DxbcOpcode::DclInputControlPointCount: + return this->emitDclInputControlPointCount(ins); + + case DxbcOpcode::DclOutputControlPointCount: + return this->emitDclOutputControlPointCount(ins); + case DxbcOpcode::DclThreadGroup: return this->emitDclThreadGroup(ins); @@ -1055,6 +1061,17 @@ namespace dxvk { } + void DxbcCompiler::emitDclInputControlPointCount(const DxbcShaderInstruction& ins) { + m_hs.vertexCountIn = ins.controls.controlPointCount; + } + + + void DxbcCompiler::emitDclOutputControlPointCount(const DxbcShaderInstruction& ins) { + m_module.setOutputVertices(m_entryPointId, ins.controls.controlPointCount); + m_hs.vertexCountOut = ins.controls.controlPointCount; + } + + void DxbcCompiler::emitDclThreadGroup(const DxbcShaderInstruction& ins) { // dcl_thread_group has three operands: // (imm0) Number of threads in X dimension diff --git a/src/dxbc/dxbc_compiler.h b/src/dxbc/dxbc_compiler.h index 0c652fb2..784ccc2d 100644 --- a/src/dxbc/dxbc_compiler.h +++ b/src/dxbc/dxbc_compiler.h @@ -196,8 +196,11 @@ namespace dxvk { * \brief Hull shader-specific structure */ struct DxbcCompilerHsPart { - DxbcCompilerHsPhase currPhaseType = DxbcCompilerHsPhase::None; - size_t currPhaseId = 0; + DxbcCompilerHsPhase currPhaseType = DxbcCompilerHsPhase::None; + size_t currPhaseId = 0; + + uint32_t vertexCountIn = 0; + uint32_t vertexCountOut = 0; DxbcCompilerHsControlPointPhase cpPhase; std::vector forkPhases; @@ -455,6 +458,12 @@ namespace dxvk { void emitDclMaxOutputVertexCount( const DxbcShaderInstruction& ins); + void emitDclInputControlPointCount( + const DxbcShaderInstruction& ins); + + void emitDclOutputControlPointCount( + const DxbcShaderInstruction& ins); + void emitDclThreadGroup( const DxbcShaderInstruction& ins); diff --git a/src/dxbc/dxbc_decoder.cpp b/src/dxbc/dxbc_decoder.cpp index a0febb66..2447a05b 100644 --- a/src/dxbc/dxbc_decoder.cpp +++ b/src/dxbc/dxbc_decoder.cpp @@ -124,6 +124,8 @@ namespace dxvk { static_cast(bit::extract(token, 11, 17)); m_instruction.controls.primitive = static_cast(bit::extract(token, 11, 16)); + m_instruction.controls.controlPointCount = + static_cast(bit::extract(token, 11, 16)); // Process extended opcode tokens while (bit::extract(token, 31, 31)) { diff --git a/src/dxbc/dxbc_decoder.h b/src/dxbc/dxbc_decoder.h index 14095ec5..ac763bed 100644 --- a/src/dxbc/dxbc_decoder.h +++ b/src/dxbc/dxbc_decoder.h @@ -251,6 +251,7 @@ namespace dxvk { DxbcSamplerMode samplerMode; DxbcPrimitiveTopology primitiveTopology; DxbcPrimitive primitive; + uint32_t controlPointCount; }; diff --git a/src/dxbc/dxbc_defs.cpp b/src/dxbc/dxbc_defs.cpp index 6590e082..e46e0f85 100644 --- a/src/dxbc/dxbc_defs.cpp +++ b/src/dxbc/dxbc_defs.cpp @@ -716,9 +716,9 @@ namespace dxvk { /* DclInterface */ { }, /* DclInputControlPointCount */ - { }, + { 0, DxbcInstClass::Declaration }, /* DclOutputControlPointCount */ - { }, + { 0, DxbcInstClass::Declaration }, /* DclTessDomain */ { }, /* DclTessPartitioning */