1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 22:24:15 +01:00

[dxbc] Implemented Hull Shader control point count declarations

This commit is contained in:
Philip Rebohle 2018-03-01 12:47:24 +01:00
parent 0916115086
commit feba1f0e88
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 33 additions and 4 deletions

View File

@ -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

View File

@ -199,6 +199,9 @@ namespace dxvk {
DxbcCompilerHsPhase currPhaseType = DxbcCompilerHsPhase::None;
size_t currPhaseId = 0;
uint32_t vertexCountIn = 0;
uint32_t vertexCountOut = 0;
DxbcCompilerHsControlPointPhase cpPhase;
std::vector<DxbcCompilerHsForkJoinPhase> forkPhases;
std::vector<DxbcCompilerHsForkJoinPhase> joinPhases;
@ -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);

View File

@ -124,6 +124,8 @@ namespace dxvk {
static_cast<DxbcPrimitiveTopology>(bit::extract(token, 11, 17));
m_instruction.controls.primitive =
static_cast<DxbcPrimitive>(bit::extract(token, 11, 16));
m_instruction.controls.controlPointCount =
static_cast<uint32_t>(bit::extract(token, 11, 16));
// Process extended opcode tokens
while (bit::extract(token, 31, 31)) {

View File

@ -251,6 +251,7 @@ namespace dxvk {
DxbcSamplerMode samplerMode;
DxbcPrimitiveTopology primitiveTopology;
DxbcPrimitive primitive;
uint32_t controlPointCount;
};

View File

@ -716,9 +716,9 @@ namespace dxvk {
/* DclInterface */
{ },
/* DclInputControlPointCount */
{ },
{ 0, DxbcInstClass::Declaration },
/* DclOutputControlPointCount */
{ },
{ 0, DxbcInstClass::Declaration },
/* DclTessDomain */
{ },
/* DclTessPartitioning */