From 6cf12db4826c1cc4c2d481d44b1eb6de1e39b774 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 5 May 2018 15:00:32 -0700 Subject: Fixed GLSL shader compilation to generate bindings and descriptor sets; updated SPIRV resource loading --- Graphics/GraphicsEngineVulkan/include/PipelineLayout.h | 12 ------------ Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h | 5 +++-- Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp | 6 ------ Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp | 9 +++++---- 4 files changed, 8 insertions(+), 24 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineLayout.h b/Graphics/GraphicsEngineVulkan/include/PipelineLayout.h index efe4caef..625e1f3d 100644 --- a/Graphics/GraphicsEngineVulkan/include/PipelineLayout.h +++ b/Graphics/GraphicsEngineVulkan/include/PipelineLayout.h @@ -160,18 +160,6 @@ private: uint8_t m_ActiveSets = 0; }; -#if 0 - static constexpr Uint8 InvalidRootTableIndex = static_cast(-1); - - // The array below contains array index of a CBV/SRV/UAV root table - // in m_RootParams (NOT the Root Index!), for every variable type - // (static, mutable, dynamic) and every shader type, - // or -1, if the table is not yet assigned to the combination - Uint8 m_SrvCbvUavRootTablesMap[SHADER_VARIABLE_TYPE_NUM_TYPES * 6]; - // This array contains the same data for Sampler root table - Uint8 m_SamplerRootTablesMap[SHADER_VARIABLE_TYPE_NUM_TYPES * 6]; -#endif - IMemoryAllocator &m_MemAllocator; DescriptorSetLayoutManager m_LayoutMgr; diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h index 0ebfe80c..5ec8d260 100644 --- a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h @@ -33,6 +33,7 @@ #include "ShaderResourceLayoutVk.h" #include "AdaptiveFixedBlockAllocator.h" #include "VulkanUtilities/VulkanObjectWrappers.h" +#include "PipelineLayout.h" /// Namespace for the Direct3D11 implementation of the graphics engine namespace Diligent @@ -127,8 +128,8 @@ private: #endif VulkanUtilities::RenderPassWrapper m_RenderPass; VulkanUtilities::PipelineWrapper m_Pipeline; - VulkanUtilities::PipelineLayoutWrapper m_PipelineLayout; - + PipelineLayout m_PipelineLayout; + VulkanUtilities::PipelineLayoutWrapper m_TmpPipelineLayout; }; } diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp index ab69114e..c7a80ace 100644 --- a/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp +++ b/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp @@ -301,12 +301,6 @@ PipelineLayout::PipelineLayout() : m_StaticSamplers( STD_ALLOCATOR_RAW_MEM(StaticSamplerAttribs, GetRawAllocator(), "Allocator for vector") ) */ { -#if 0 - for(size_t i=0; i < _countof(m_SrvCbvUavRootTablesMap); ++i) - m_SrvCbvUavRootTablesMap[i] = InvalidRootTableIndex; - for(size_t i=0; i < _countof(m_SamplerRootTablesMap); ++i) - m_SamplerRootTablesMap[i] = InvalidRootTableIndex; -#endif } void PipelineLayout::Release(RenderDeviceVkImpl *pDeviceVkImpl) diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp index 8fccd1e8..17f4bcda 100644 --- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp @@ -144,7 +144,7 @@ void PipelineStateVkImpl::CreateRenderPass(const VulkanUtilities::VulkanLogicalD PipelineStateVkImpl :: PipelineStateVkImpl(IReferenceCounters *pRefCounters, RenderDeviceVkImpl *pDeviceVk, const PipelineStateDesc &PipelineDesc) : TPipelineStateBase(pRefCounters, pDeviceVk, PipelineDesc)/*, - m_DummyVar(*this), + m_DummyVar(*this) m_ResourceCacheDataAllocator(GetRawAllocator(), PipelineDesc.SRBAllocationGranularity), m_pDefaultShaderResBinding(nullptr, STDDeleter(pDeviceVk->GetSRBAllocator()) ) */ @@ -353,8 +353,8 @@ PipelineStateVkImpl :: PipelineStateVkImpl(IReferenceCounters *pRefCounters, Ren PipelineLayoutCI.pSetLayouts = nullptr; PipelineLayoutCI.pushConstantRangeCount = 0; PipelineLayoutCI.pPushConstantRanges = nullptr; - m_PipelineLayout = LogicalDevice.CreatePipelineLayout(PipelineLayoutCI); - PipelineCI.layout = m_PipelineLayout; + m_TmpPipelineLayout = LogicalDevice.CreatePipelineLayout(PipelineLayoutCI); + PipelineCI.layout = m_TmpPipelineLayout; PipelineCI.renderPass = m_RenderPass; PipelineCI.subpass = 0; @@ -423,7 +423,8 @@ PipelineStateVkImpl::~PipelineStateVkImpl() pDeviceVkImpl->GetFramebufferCache().OnDestroyRenderPass(m_RenderPass); pDeviceVkImpl->SafeReleaseVkObject(std::move(m_RenderPass)); pDeviceVkImpl->SafeReleaseVkObject(std::move(m_Pipeline)); - pDeviceVkImpl->SafeReleaseVkObject(std::move(m_PipelineLayout)); + m_PipelineLayout.Release(pDeviceVkImpl); + //pDeviceVkImpl->SafeReleaseVkObject(std::move(m_TmpPipelineLayout)); #if 0 auto &ShaderResLayoutAllocator = GetRawAllocator(); -- cgit v1.2.3