From 201cb88d27ebd9aef02f25733e29a9649e95716b Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 3 Feb 2018 10:36:17 +0100 Subject: [PATCH] [dxbc] Remove push constant block for now This needs some more work. --- src/dxbc/dxbc_compiler.cpp | 30 ------------------------------ src/dxvk/dxvk_context.cpp | 35 ++++++++++++++--------------------- 2 files changed, 14 insertions(+), 51 deletions(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 63cfa77c4..8bcc72ac3 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -4482,8 +4482,6 @@ namespace dxvk { m_module.enableCapability(spv::CapabilityShader); m_module.enableCapability(spv::CapabilityImageQuery); - m_pushConstantBlock = getPushConstantBlockId(); - // Initialize the shader module with capabilities // etc. Each shader type has its own peculiarities. switch (m_version.type()) { @@ -4921,32 +4919,4 @@ namespace dxvk { return typeId; } - - uint32_t DxbcCompiler::getPushConstantBlockId() { - uint32_t t_u32 = m_module.defIntType(32, 0); - - std::array members; - members[PushConstant_InstanceId] = t_u32; - - uint32_t typeId = m_module.defStructTypeUnique( - members.size(), members.data()); - - m_module.memberDecorateOffset(typeId, 0, 0); - m_module.decorateBlock(typeId); - - m_module.setDebugName(typeId, "s_push_constant"); - m_module.setDebugMemberName(typeId, PerVertex_Position, "instance_id"); - - // There's only ever going to be one single push constant - // block per shader, so we'll declare the variable here - uint32_t ptrTypeId = m_module.defPointerType( - typeId, spv::StorageClassPushConstant); - - uint32_t varId = m_module.newVar( - ptrTypeId, spv::StorageClassPushConstant); - - m_module.setDebugName(varId, "push_constant"); - return varId; - } - } \ No newline at end of file diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 591ba948f..4e538f119 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -572,16 +572,9 @@ namespace dxvk { this->commitGraphicsState(); if (m_gpActivePipeline != VK_NULL_HANDLE) { - if (!m_flags.test(DxvkContextFlag::GpEmulateInstanceFetchRate)) { - m_cmd->cmdDraw( - vertexCount, instanceCount, - firstVertex, firstInstance); - } else { - static bool errorShown = false; - - if (!std::exchange(errorShown, true)) - Logger::warn("Dxvk: GpEmulateInstanceFetchRate not supported for direct draws"); - } + m_cmd->cmdDraw( + vertexCount, instanceCount, + firstVertex, firstInstance); } } @@ -595,17 +588,10 @@ namespace dxvk { if (m_gpActivePipeline != VK_NULL_HANDLE) { auto physicalSlice = buffer.physicalSlice(); - if (!m_flags.test(DxvkContextFlag::GpEmulateInstanceFetchRate)) { - m_cmd->cmdDrawIndirect( - physicalSlice.handle(), - physicalSlice.offset(), - count, stride); - } else { - static bool errorShown = false; - - if (!std::exchange(errorShown, true)) - Logger::warn("Dxvk: GpEmulateInstanceFetchRate not supported for indirect draws"); - } + m_cmd->cmdDrawIndirect( + physicalSlice.handle(), + physicalSlice.offset(), + count, stride); } } @@ -1083,6 +1069,13 @@ namespace dxvk { m_state.gp.state.ilAttributeCount = attributeCount; m_state.gp.state.ilBindingCount = bindingCount; + + if (m_flags.test(DxvkContextFlag::GpEmulateInstanceFetchRate)) { + static bool errorShown = false; + + if (!std::exchange(errorShown, true)) + Logger::warn("Dxvk: GpEmulateInstanceFetchRate not handled yet"); + } }