1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-01 19:29:16 +01:00

[dxbc] Formatting fixes + Hull shader barriers

This commit is contained in:
Philip Rebohle 2018-03-05 16:14:46 +01:00
parent 96ca9fa6ea
commit 4688b2cc5a
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 23 additions and 7 deletions

View File

@ -372,11 +372,11 @@ namespace dxvk {
// be stored in the second operand.
const bool hasSv =
ins.op == DxbcOpcode::DclInputSgv
|| ins.op == DxbcOpcode::DclInputSiv
|| ins.op == DxbcOpcode::DclInputPsSgv
|| ins.op == DxbcOpcode::DclInputPsSiv
|| ins.op == DxbcOpcode::DclOutputSgv
|| ins.op == DxbcOpcode::DclOutputSiv;
|| ins.op == DxbcOpcode::DclInputSiv
|| ins.op == DxbcOpcode::DclInputPsSgv
|| ins.op == DxbcOpcode::DclInputPsSiv
|| ins.op == DxbcOpcode::DclOutputSgv
|| ins.op == DxbcOpcode::DclOutputSiv;
DxbcSystemValue sv = DxbcSystemValue::None;
@ -387,7 +387,7 @@ namespace dxvk {
// interpolation mode that is part of the op token.
const bool hasInterpolationMode =
ins.op == DxbcOpcode::DclInputPs
|| ins.op == DxbcOpcode::DclInputPsSiv;
|| ins.op == DxbcOpcode::DclInputPsSiv;
DxbcInterpolationMode im = DxbcInterpolationMode::Undefined;
@ -603,7 +603,6 @@ namespace dxvk {
m_interfaceSlots.outputSlots |= 1u << regIdx;
}
// Add a new system value mapping if needed
if (sv != DxbcSystemValue::None)
m_oMappings.push_back({ regIdx, regMask, sv });
@ -5122,11 +5121,17 @@ namespace dxvk {
void DxbcCompiler::emitHsFinalize() {
this->emitHsControlPointPhase(m_hs.cpPhase);
if (m_hs.forkPhases.size() != 0
|| m_hs.joinPhases.size() != 0)
this->emitHsPhaseBarrier();
for (const auto& phase : m_hs.forkPhases)
this->emitHsForkJoinPhase(phase);
for (const auto& phase : m_hs.joinPhases)
this->emitHsForkJoinPhase(phase);
// TODO set up output variables
}
@ -5247,6 +5252,15 @@ namespace dxvk {
}
void DxbcCompiler::emitHsPhaseBarrier() {
uint32_t exeScopeId = m_module.constu32(spv::ScopeWorkgroup);
uint32_t memScopeId = m_module.constu32(spv::ScopeInvocation);
uint32_t semanticId = m_module.constu32(spv::MemorySemanticsMaskNone);
m_module.opControlBarrier(exeScopeId, memScopeId, semanticId);
}
uint32_t DxbcCompiler::emitNewVariable(const DxbcRegisterInfo& info) {
const uint32_t ptrTypeId = this->getPointerTypeId(info);
return m_module.newVar(ptrTypeId, info.sclass);

View File

@ -867,6 +867,8 @@ namespace dxvk {
void emitHsForkJoinPhase(
const DxbcCompilerHsForkJoinPhase& phase);
void emitHsPhaseBarrier();
//////////////
// Misc stuff
void emitDclInputArray(