diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-05-28 16:11:50 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-05-28 16:11:50 +0000 |
| commit | 67d0f61340de301595aedc54fb8f29f184c16f8f (patch) | |
| tree | 4cf13ca339ac26d7277710f8d71a6bbe1b5ca3b8 /Graphics/GraphicsEngineVulkan | |
| parent | Minor update (diff) | |
| download | DiligentCore-67d0f61340de301595aedc54fb8f29f184c16f8f.tar.gz DiligentCore-67d0f61340de301595aedc54fb8f29f184c16f8f.zip | |
Cosmetic changes
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
3 files changed, 8 insertions, 4 deletions
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<SPIRVShaderResources>(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<SHADER_VARIABLE_TYPE, 1> VarTypes = {SHADER_VARIABLE_TYPE_STATIC}; m_StaticResLayout.Initialize(m_pShaderResources, GetRawAllocator(), VarTypes.data(), static_cast<Uint32>(VarTypes.size()), &m_StaticResCache, nullptr, nullptr); |
