summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-03-06 18:03:57 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-03-06 18:03:57 +0000
commit76a1a90ee26e3f2e78fab018bbbfc43ddc85d849 (patch)
treead4f6db4cee83516a5f1e1867b4113fa64f32dec /Graphics
parentFixed few more clang warnings (diff)
downloadDiligentCore-76a1a90ee26e3f2e78fab018bbbfc43ddc85d849.tar.gz
DiligentCore-76a1a90ee26e3f2e78fab018bbbfc43ddc85d849.zip
Removed unused m_ResourceLayout member from ShaderVariableManagerVk and ShaderVariableManagerD3D12 plus a bunch of minor updates to fix clang warnings
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.h10
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp7
-rw-r--r--Graphics/GraphicsEngineMetal/src/TextureMtlImpl.mm2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h8
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h10
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp1
6 files changed, 16 insertions, 22 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.h b/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.h
index 85dc30c7..8b9f8fb8 100644
--- a/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.h
+++ b/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.h
@@ -66,7 +66,7 @@ namespace Diligent
class ShaderVariableD3D12Impl;
-// sizeof(ShaderVariableManagerD3D12) == 40 (x64, msvc, Release)
+// sizeof(ShaderVariableManagerD3D12) == 32 (x64, msvc, Release)
class ShaderVariableManagerD3D12
{
public:
@@ -99,11 +99,9 @@ private:
IObject& m_Owner;
- // Variable mgr is owned by either PSO object (in which case m_pResourceLayout points to
- // static resource layout owned by the same PSO object), or by SRB object (in which case
- // 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 ShaderResourceLayoutD3D12& m_ResourceLayout;
+ // Variable mgr is owned by either Pipeline state object (in which case m_ResourceCache references
+ // static resource cache owned by the same PSO object), or by SRB object (in which case
+ // m_ResourceCache references the cache in the SRB). Thus the cache is guaranteed to be alive.
ShaderResourceCacheD3D12& m_ResourceCache;
// Memory is allocated through the allocator provided by the pipeline state. If allocation granularity > 1, fixed block
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp
index 3c14c461..de8e9855 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp
@@ -56,11 +56,10 @@ ShaderVariableManagerD3D12::ShaderVariableManagerD3D12(IObject&
const SHADER_RESOURCE_VARIABLE_TYPE* AllowedVarTypes,
Uint32 NumAllowedTypes,
ShaderResourceCacheD3D12& ResourceCache) :
- m_Owner (Owner),
- m_ResourceLayout (SrcLayout),
- m_ResourceCache (ResourceCache)
+ m_Owner (Owner),
+ m_ResourceCache (ResourceCache)
#ifdef _DEBUG
- , m_DbgAllocator(Allocator)
+ , m_DbgAllocator (Allocator)
#endif
{
diff --git a/Graphics/GraphicsEngineMetal/src/TextureMtlImpl.mm b/Graphics/GraphicsEngineMetal/src/TextureMtlImpl.mm
index 70f54ac8..b89b0c35 100644
--- a/Graphics/GraphicsEngineMetal/src/TextureMtlImpl.mm
+++ b/Graphics/GraphicsEngineMetal/src/TextureMtlImpl.mm
@@ -40,7 +40,7 @@ TextureMtlImpl :: TextureMtlImpl(IReferenceCounters* pRefCounters,
{
LOG_ERROR_AND_THROW("Textures are not implemented in Metal backend");
- if( TexDesc.Usage == USAGE_STATIC && pInitData == nullptr || pInitData->pSubResources == nullptr )
+ if( (TexDesc.Usage == USAGE_STATIC && pInitData == nullptr) || pInitData->pSubResources == nullptr )
LOG_ERROR_AND_THROW("Static Texture must be initialized with data at creation time");
SetState(RESOURCE_STATE_UNDEFINED);
}
diff --git a/Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h b/Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h
index 1b650828..95659276 100644
--- a/Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h
+++ b/Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h
@@ -148,7 +148,7 @@ namespace Diligent
}
};
- struct UniformBufferInfo : GLProgramVariableBase
+ struct UniformBufferInfo final : GLProgramVariableBase
{
UniformBufferInfo (const UniformBufferInfo&) = delete;
UniformBufferInfo& operator= (const UniformBufferInfo&) = delete;
@@ -183,7 +183,7 @@ namespace Diligent
static_assert( (sizeof(UniformBufferInfo) % sizeof(void*)) == 0, "sizeof(UniformBufferInfo) must be multiple of sizeof(void*)");
- struct SamplerInfo : GLProgramVariableBase
+ struct SamplerInfo final : GLProgramVariableBase
{
SamplerInfo (const SamplerInfo&) = delete;
SamplerInfo& operator= (const SamplerInfo&) = delete;
@@ -225,7 +225,7 @@ namespace Diligent
static_assert( (sizeof(SamplerInfo) % sizeof(void*)) == 0, "sizeof(SamplerInfo) must be multiple of sizeof(void*)");
- struct ImageInfo : GLProgramVariableBase
+ struct ImageInfo final : GLProgramVariableBase
{
ImageInfo (const ImageInfo&) = delete;
ImageInfo& operator= (const ImageInfo&) = delete;
@@ -264,7 +264,7 @@ namespace Diligent
static_assert( (sizeof(ImageInfo) % sizeof(void*)) == 0, "sizeof(ImageInfo) must be multiple of sizeof(void*)");
- struct StorageBlockInfo : GLProgramVariableBase
+ struct StorageBlockInfo final : GLProgramVariableBase
{
StorageBlockInfo (const StorageBlockInfo&) = delete;
StorageBlockInfo& operator= (const StorageBlockInfo&) = delete;
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
index 74dac81d..0b7e3aa0 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.h
@@ -64,7 +64,7 @@ namespace Diligent
class ShaderVariableVkImpl;
-// sizeof(ShaderVariableManagerVk) == 40 (x64, msvc, Release)
+// sizeof(ShaderVariableManagerVk) == 32 (x64, msvc, Release)
class ShaderVariableManagerVk
{
public:
@@ -97,11 +97,9 @@ private:
Uint32 GetVariableIndex(const ShaderVariableVkImpl& Variable);
IObject& m_Owner;
- // Variable mgr is owned by either Pipeline state object (in which case m_pResourceLayout points to
- // static resource layout owned by the same PSO object), or by SRB object (in which case
- // m_pResourceLayout points to corresponding layout in pipeline state). Since SRB keeps strong
- // reference to PSO, the layout is guaranteed to be alive while SRB is alive
- const ShaderResourceLayoutVk& m_ResourceLayout;
+ // Variable mgr is owned by either Pipeline state object (in which case m_ResourceCache references
+ // static resource cache owned by the same PSO object), or by SRB object (in which case
+ // m_ResourceCache references the cache in the SRB). Thus the cache is guaranteed to be alive.
ShaderResourceCacheVk& m_ResourceCache;
// Memory is allocated through the allocator provided by the pipeline state. If allocation granularity > 1, fixed block
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
index d005dc26..9d6bbf96 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
@@ -68,7 +68,6 @@ ShaderVariableManagerVk::ShaderVariableManagerVk(IObject&
Uint32 NumAllowedTypes,
ShaderResourceCacheVk& ResourceCache) :
m_Owner(Owner),
- m_ResourceLayout(SrcLayout),
m_ResourceCache(ResourceCache)
#ifdef _DEBUG
, m_DbgAllocator(Allocator)