summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-25 04:30:56 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-25 04:30:56 +0000
commite4d4b58af6aedc7a0bffd821d86947f3b7c8b937 (patch)
tree1610c6de05bb2d1e73ad0658e9be245960ce5744 /Graphics/GraphicsEngineVulkan
parentImplemented shader variable access by Index in GL backend (diff)
downloadDiligentCore-e4d4b58af6aedc7a0bffd821d86947f3b7c8b937.tar.gz
DiligentCore-e4d4b58af6aedc7a0bffd821d86947f3b7c8b937.zip
Fixed https://github.com/DiligentGraphics/DiligentCore/issues/16 (Rework D3D12 shader resource layout to use shader variable manager)
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h4
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h7
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp2
3 files changed, 6 insertions, 7 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h
index 23264799..6ebea962 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h
@@ -39,7 +39,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IShaderResourceBindingVk interface
-// sizeof(ShaderResourceBindingVkImpl) == 80 (x64, msvc, Release)
+// sizeof(ShaderResourceBindingVkImpl) == 72 (x64, msvc, Release)
class ShaderResourceBindingVkImpl final : public ShaderResourceBindingBase<IShaderResourceBindingVk>
{
public:
@@ -70,7 +70,7 @@ private:
// Shader variable manager index in m_pShaderVarMgrs[] array for every shader stage
Int8 m_ResourceLayoutIndex[6] = {-1, -1, -1, -1, -1, -1};
bool m_bStaticResourcesInitialized = false;
- Uint32 m_NumShaders = 0;
+ Uint8 m_NumShaders = 0;
};
}
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
index 5071b857..4681da82 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
@@ -35,7 +35,7 @@
//
// __________________________ __________________________________________________________________________
// | | | | | |
-// ----| ShaderVariableManagerVk |---------------->| ShaderVariableVkImpl[0] | ShaderVariableVkImpl[1] | ... |
+// .----| ShaderVariableManagerVk |---------------->| ShaderVariableVkImpl[0] | ShaderVariableVkImpl[1] | ... |
// | |__________________________| |___________________________|____________________________|_________________|
// | | \ |
// | | Ref Ref
@@ -50,13 +50,12 @@
// | \ /
// | __________________________ ________V_______________________________________________________V_______
// | | | | |
-// --->| ShaderResourceCacheVk |---------------->| Resources |
+// '--->| ShaderResourceCacheVk |---------------->| Resources |
// |__________________________| |________________________________________________________________________|
//
//
#include <memory>
-#include <unordered_map>
#include "ShaderResourceLayoutVk.h"
@@ -101,7 +100,7 @@ private:
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
+ // m_pResourceLayout points 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/ShaderResourceBindingVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
index f91eea9b..abc033e0 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
@@ -36,7 +36,7 @@ ShaderResourceBindingVkImpl::ShaderResourceBindingVkImpl( IReferenceCounters* pR
m_ShaderResourceCache(ShaderResourceCacheVk::DbgCacheContentType::SRBResources)
{
auto* ppShaders = pPSO->GetShaders();
- m_NumShaders = pPSO->GetNumShaders();
+ m_NumShaders = static_cast<decltype(m_NumShaders)>(pPSO->GetNumShaders());
auto* pRenderDeviceVkImpl = pPSO->GetDevice();
// This will only allocate memory and initialize descriptor sets in the resource cache