mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxbc] Serialize hull shader fork/join phase invocations
We cannot run these in parallel in case the hull shader's output vertex count, and thus the invocation count, is less than the fork/join phase invocation count.
This commit is contained in:
parent
2973c18055
commit
eb85f61084
@ -5620,15 +5620,15 @@ namespace dxvk {
|
|||||||
this->emitHsControlPointPhase(m_hs.cpPhase);
|
this->emitHsControlPointPhase(m_hs.cpPhase);
|
||||||
this->emitHsPhaseBarrier();
|
this->emitHsPhaseBarrier();
|
||||||
|
|
||||||
// Fork-join phases (will run in parallel)
|
// Fork-join phases and output setup
|
||||||
|
this->emitHsInvocationBlockBegin(1);
|
||||||
|
|
||||||
for (const auto& phase : m_hs.forkPhases)
|
for (const auto& phase : m_hs.forkPhases)
|
||||||
this->emitHsForkJoinPhase(phase);
|
this->emitHsForkJoinPhase(phase);
|
||||||
|
|
||||||
for (const auto& phase : m_hs.joinPhases)
|
for (const auto& phase : m_hs.joinPhases)
|
||||||
this->emitHsForkJoinPhase(phase);
|
this->emitHsForkJoinPhase(phase);
|
||||||
|
|
||||||
// Output setup phase
|
|
||||||
this->emitHsInvocationBlockBegin(1);
|
|
||||||
this->emitOutputSetup();
|
this->emitOutputSetup();
|
||||||
this->emitHsInvocationBlockEnd();
|
this->emitHsInvocationBlockEnd();
|
||||||
this->emitMainFunctionEnd();
|
this->emitMainFunctionEnd();
|
||||||
@ -5692,19 +5692,14 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxbcCompiler::emitHsForkJoinPhase(
|
void DxbcCompiler::emitHsForkJoinPhase(
|
||||||
const DxbcCompilerHsForkJoinPhase& phase) {
|
const DxbcCompilerHsForkJoinPhase& phase) {
|
||||||
this->emitHsInvocationBlockBegin(phase.instanceCount);
|
for (uint32_t i = 0; i < phase.instanceCount; i++) {
|
||||||
|
uint32_t invocationId = m_module.constu32(i);
|
||||||
uint32_t invocationId = m_module.opLoad(
|
|
||||||
getScalarTypeId(DxbcScalarType::Uint32),
|
m_module.opFunctionCall(
|
||||||
m_hs.builtinInvocationId);
|
m_module.defVoidType(),
|
||||||
|
phase.functionId, 1,
|
||||||
m_module.opFunctionCall(
|
&invocationId);
|
||||||
m_module.defVoidType(),
|
}
|
||||||
phase.functionId, 1,
|
|
||||||
&invocationId);
|
|
||||||
|
|
||||||
this->emitHsInvocationBlockEnd();
|
|
||||||
this->emitHsPhaseBarrier();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user