From 67d0f61340de301595aedc54fb8f29f184c16f8f Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 28 May 2018 09:11:50 -0700 Subject: Cosmetic changes --- Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h | 2 +- Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h | 6 +++++- Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h b/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h index d1dda4de..8cb9e638 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h @@ -29,7 +29,7 @@ // Shader resource cache stores Vk resources in a continuous chunk of memory: // // |Vulkan Descriptor Set| -// A ____________________________________________________________ +// A ___________________________________________________________ // m_pMemory | | m_pResources, m_NumResources == m | // | m_DescriptorSetAllocation| | | // V | | V diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h index fff164d4..a1a7c552 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h @@ -27,7 +27,7 @@ /// Declaration of Diligent::ShaderVariableManagerVk and Diligent::ShaderVariableVkImpl classes // -// * ShaderVariableManagerVk keeps list of variables of a specific type. +// * ShaderVariableManagerVk keeps list of variables of specific types // * Every ShaderVariableVkImpl references VkResource from ShaderResourceLayoutVk // * ShaderVariableManagerVk keeps pointer to ShaderResourceCacheVk // * ShaderVariableManagerVk is used by ShaderVkImpl to manage static resources and by @@ -89,6 +89,10 @@ private: friend ShaderVariableVkImpl; IObject& m_Owner; + // Variable mgr is owned by either Shader object (in which case m_pResourceLayout points to + // static resource layout owned by the same shader object), or by SRB object (in which case + // m_pResourceLayout point to corresponding layout in pipeline state). Since SRB keeps strong + // reference to PSO, the layout is guaranteed be alive while SRB is alive const ShaderResourceLayoutVk* m_pResourceLayout= nullptr; ShaderResourceCacheVk* m_pResourceCache = nullptr; diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index 69bc2dfc..c18ab8ae 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -38,8 +38,8 @@ namespace Diligent ShaderVkImpl::ShaderVkImpl(IReferenceCounters *pRefCounters, RenderDeviceVkImpl *pRenderDeviceVk, const ShaderCreationAttribs &CreationAttribs) : TShaderBase(pRefCounters, pRenderDeviceVk, CreationAttribs.Desc), - m_StaticResLayout(*this, pRenderDeviceVk->GetLogicalDevice(), GetRawAllocator()), m_DummyShaderVar(*this), + m_StaticResLayout(*this, pRenderDeviceVk->GetLogicalDevice(), GetRawAllocator()), m_StaticResCache(ShaderResourceCacheVk::DbgCacheContentType::StaticShaderResources), m_StaticVarsMgr(*this) { @@ -59,7 +59,7 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters *pRefCounters, RenderDeviceVkImpl auto *pResources = new (pRawMem) SPIRVShaderResources(Allocator, pRenderDeviceVk, m_SPIRV, m_Desc); m_pShaderResources.reset(pResources, STDDeleterRawMem(Allocator)); - // Clone only static resources that will be set directly in the shader + // Clone only static resources that will be set directly through the shader object std::array VarTypes = {SHADER_VARIABLE_TYPE_STATIC}; m_StaticResLayout.Initialize(m_pShaderResources, GetRawAllocator(), VarTypes.data(), static_cast(VarTypes.size()), &m_StaticResCache, nullptr, nullptr); -- cgit v1.2.3