From f38cfd592ec0894ed456468a5d456bcc5898340a Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 22 Sep 2019 22:36:42 +0200 Subject: [PATCH] [dbxc] Actually fix callc implementation Yeah maybe we should close our blocks properly. There seems to be no way to generate a callc instruction with fxc so this is untested. --- src/dxbc/dxbc_compiler.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index c3134000..18870906 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -4213,21 +4213,22 @@ namespace dxvk { condition, ins.controls.zeroTest()); // We basically have to wrap this into an 'if' block - const uint32_t callLabel = m_module.allocateId(); - const uint32_t continueLabel = m_module.allocateId(); + const uint32_t callLabel = m_module.allocateId(); + const uint32_t skipLabel = m_module.allocateId(); - m_module.opSelectionMerge(continueLabel, + m_module.opSelectionMerge(skipLabel, spv::SelectionControlMaskNone); m_module.opBranchConditional( - zeroTest.id, callLabel, continueLabel); + zeroTest.id, callLabel, skipLabel); m_module.opLabel(callLabel); m_module.opFunctionCall( m_module.defVoidType(), functionId, 0, nullptr); - m_module.opLabel(continueLabel); + m_module.opBranch(skipLabel); + m_module.opLabel(skipLabel); }