summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-05-28 18:17:58 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-05-28 18:17:58 +0000
commit0b043b001d295b6d15a36394fe167f241d0470a4 (patch)
treec200122c1aaf7ce1bf732ff9beeef07fdacad223 /Graphics/GraphicsEngineVulkan
parentCosmetic changes (diff)
downloadDiligentCore-0b043b001d295b6d15a36394fe167f241d0470a4.tar.gz
DiligentCore-0b043b001d295b6d15a36394fe167f241d0470a4.zip
Some minor updates
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h9
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp7
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp6
4 files changed, 22 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h b/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h
index 8cb9e638..f2129a41 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.h
@@ -88,6 +88,10 @@ public:
// sizeof(Resource) == 16 (x64, msvc, Release)
struct Resource
{
+ Resource(SPIRVShaderResourceAttribs::ResourceType _Type) :
+ Type(_Type)
+ {}
+
Resource(const Resource&) = delete;
Resource(Resource&&) = delete;
Resource& operator = (const Resource&) = delete;
@@ -111,6 +115,11 @@ public:
m_pResources (pResources)
{}
+ DescriptorSet(const DescriptorSet&) = delete;
+ DescriptorSet(DescriptorSet&&) = delete;
+ DescriptorSet& operator = (const DescriptorSet&) = delete;
+ DescriptorSet& operator = (DescriptorSet&&) = delete;
+
inline Resource& GetResource(Uint32 CacheOffset)
{
VERIFY(CacheOffset < m_NumResources, "Offset ", CacheOffset, " is out of range" );
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
index a1a7c552..e533a4b0 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
@@ -117,10 +117,10 @@ public:
m_Resource(Resource)
{}
- ShaderVariableVkImpl(const ShaderVariableVkImpl&) = delete;
- ShaderVariableVkImpl(ShaderVariableVkImpl&&) = delete;
+ ShaderVariableVkImpl (const ShaderVariableVkImpl&) = delete;
+ ShaderVariableVkImpl (ShaderVariableVkImpl&&) = delete;
ShaderVariableVkImpl& operator= (const ShaderVariableVkImpl&) = delete;
- ShaderVariableVkImpl& operator= (ShaderVariableVkImpl&&) = delete;
+ ShaderVariableVkImpl& operator= (ShaderVariableVkImpl&&) = delete;
virtual IReferenceCounters* GetReferenceCounters()const override final
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
index 5c3f53ea..5888f0b2 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
@@ -463,6 +463,10 @@ void ShaderResourceLayoutVk::VkResource::BindResource(IDeviceObject *pObj, Uint3
{
VERIFY(vkDescrSet == VK_NULL_HANDLE, "Static shader resource cache should not have vulkan descriptor set allocation");
}
+ else
+ {
+ UNEXPECTED("Unexpected shader resource cache content type");
+ }
#endif
auto &DstRes = DstDescrSet.GetResource(CacheOffset + ArrayIndex);
VERIFY(DstRes.Type == SpirvAttribs.Type, "Inconsistent types");
@@ -657,7 +661,8 @@ const Char* ShaderResourceLayoutVk::GetShaderName()const
void ShaderResourceLayoutVk::InitializeResourceMemoryInCache(ShaderResourceCacheVk& ResourceCache)const
{
- for(Uint32 r = 0; r < GetTotalResourceCount(); ++r)
+ auto TotalResources = GetTotalResourceCount();
+ for(Uint32 r = 0; r < TotalResources; ++r)
{
const auto& Res = GetResource(r);
ResourceCache.InitializeResources(Res.DescriptorSet, Res.CacheOffset, Res.SpirvAttribs.ArraySize, Res.SpirvAttribs.Type);
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
index c18ab8ae..bfcf2a4a 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
@@ -62,8 +62,10 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters *pRefCounters, RenderDeviceVkImpl
// 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);
- m_StaticVarsMgr.Initialize(m_StaticResLayout, GetRawAllocator(), nullptr, 0, m_StaticResCache);
+ VarTypes.data(), static_cast<Uint32>(VarTypes.size()),
+ &m_StaticResCache, nullptr, nullptr);
+ m_StaticVarsMgr.Initialize(m_StaticResLayout, GetRawAllocator(), VarTypes.data(),
+ static_cast<Uint32>(VarTypes.size()), m_StaticResCache);
}
ShaderVkImpl::~ShaderVkImpl()