summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-21 03:35:22 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-21 03:35:22 +0000
commit86c84f4f12d3b78678dfec7666d8aaf1d138ecc3 (patch)
tree3b90ca13bc1e5ca49f193621aa11caca209e3307 /Graphics
parentReworked UAV handling in D3D11 device context implementation: fixed potential... (diff)
downloadDiligentCore-86c84f4f12d3b78678dfec7666d8aaf1d138ecc3.tar.gz
DiligentCore-86c84f4f12d3b78678dfec7666d8aaf1d138ecc3.zip
Removed dummy shader variable. Added final kw to implementation classes.
Fixed https://github.com/DiligentGraphics/DiligentCore/issues/22
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngine/include/ShaderBase.h42
-rw-r--r--Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h2
-rwxr-xr-xGraphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h6
-rw-r--r--Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h29
-rw-r--r--Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp3
-rw-r--r--Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp27
-rw-r--r--Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp9
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp10
-rw-r--r--Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h5
-rw-r--r--Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h23
-rw-r--r--Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp1
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp24
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp10
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp16
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLESImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h1
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h1
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/Texture1DArray_OGL.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/Texture1D_OGL.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/Texture2DArray_OGL.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/Texture2D_OGL.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/Texture3D_OGL.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/TextureCubeArray_OGL.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/TextureCube_OGL.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp8
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp9
-rw-r--r--Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h9
-rw-r--r--Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h25
-rw-r--r--Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp1
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp16
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp29
71 files changed, 126 insertions, 276 deletions
diff --git a/Graphics/GraphicsEngine/include/ShaderBase.h b/Graphics/GraphicsEngine/include/ShaderBase.h
index 61ff881f..d72dc737 100644
--- a/Graphics/GraphicsEngine/include/ShaderBase.h
+++ b/Graphics/GraphicsEngine/include/ShaderBase.h
@@ -162,45 +162,6 @@ protected:
IObject &m_Owner;
};
-/// Implementation of a dummy shader variable that silently ignores all operations
-struct DummyShaderVariable final : ShaderVariableBase
-{
- DummyShaderVariable(IObject& Owner) :
- ShaderVariableBase(Owner)
- {}
-
- virtual void Set( IDeviceObject *pObject )override final
- {
- // Ignore operation
- // Probably output warning
- }
-
- virtual void SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements)override final
- {
- // Ignore operation
- // Probably output warning
- }
-
- virtual SHADER_VARIABLE_TYPE GetType()const override final
- {
- return SHADER_VARIABLE_TYPE_NUM_TYPES;
- }
-
- virtual Uint32 GetArraySize()const override final
- {
- return 0;
- }
-
- virtual const Char* GetName()const override final
- {
- return "<Not a valid variable>";
- }
-
- virtual Uint32 GetIndex()const override final
- {
- return static_cast<Uint32>(-1);
- }
-};
/// Template class implementing base functionality for a shader object
@@ -223,7 +184,6 @@ public:
/// must not keep a strong reference to the device.
ShaderBase( IReferenceCounters* pRefCounters, RenderDeviceImplType* pDevice, const ShaderDesc& ShdrDesc, bool bIsDeviceInternal = false ) :
TDeviceObjectBase( pRefCounters, pDevice, ShdrDesc, bIsDeviceInternal ),
- m_DummyShaderVar(*this),
m_VariablesDesc (ShdrDesc.NumVariables, ShaderVariableDesc(), STD_ALLOCATOR_RAW_MEM(ShaderVariableDesc, GetRawAllocator(), "Allocator for vector<ShaderVariableDesc>") ),
m_StringPool (ShdrDesc.NumVariables + ShdrDesc.NumStaticSamplers, String(), STD_ALLOCATOR_RAW_MEM(String, GetRawAllocator(), "Allocator for vector<String>")),
m_StaticSamplers(ShdrDesc.NumStaticSamplers, StaticSamplerDesc(), STD_ALLOCATOR_RAW_MEM(StaticSamplerDesc, GetRawAllocator(), "Allocator for vector<StaticSamplerDesc>") )
@@ -267,8 +227,6 @@ public:
IMPLEMENT_QUERY_INTERFACE_IN_PLACE( IID_Shader, TDeviceObjectBase )
protected:
- DummyShaderVariable m_DummyShaderVar; ///< Dummy shader variable
-
/// Shader variable descriptions
std::vector<ShaderVariableDesc, STDAllocatorRawMem<ShaderVariableDesc> > m_VariablesDesc;
/// String pool that is used to hold copies of variable names and static sampler names
diff --git a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h
index b2b09730..da5e661c 100644
--- a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h
@@ -49,7 +49,7 @@ enum class D3D11BufferState
};
/// Implementation of the Diligent::IBufferD3D11 interface
-class BufferD3D11Impl : public BufferBase<IBufferD3D11, RenderDeviceD3D11Impl, BufferViewD3D11Impl, FixedBlockMemoryAllocator>
+class BufferD3D11Impl final : public BufferBase<IBufferD3D11, RenderDeviceD3D11Impl, BufferViewD3D11Impl, FixedBlockMemoryAllocator>
{
public:
using TBufferBase = BufferBase<IBufferD3D11, RenderDeviceD3D11Impl, BufferViewD3D11Impl, FixedBlockMemoryAllocator>;
diff --git a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h
index f1f48b93..25997d9f 100644
--- a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h
@@ -36,7 +36,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IBufferViewD3D11 interface
-class BufferViewD3D11Impl : public BufferViewBase<IBufferViewD3D11, RenderDeviceD3D11Impl>
+class BufferViewD3D11Impl final : public BufferViewBase<IBufferViewD3D11, RenderDeviceD3D11Impl>
{
public:
using TBufferViewBase = BufferViewBase<IBufferViewD3D11, RenderDeviceD3D11Impl>;
diff --git a/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h
index 6dbe28bb..508e30c3 100644
--- a/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h
@@ -36,7 +36,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ICommandListD3D11 interface
-class CommandListD3D11Impl : public CommandListBase<ICommandList, RenderDeviceD3D11Impl>
+class CommandListD3D11Impl final : public CommandListBase<ICommandList, RenderDeviceD3D11Impl>
{
public:
using TCommandListBase = CommandListBase<ICommandList, RenderDeviceD3D11Impl>;
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
index 66444597..e4aab32d 100755
--- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
@@ -41,7 +41,7 @@ namespace Diligent
{
/// Implementation of the Diligent::IDeviceContextD3D11 interface
-class DeviceContextD3D11Impl : public DeviceContextBase<IDeviceContextD3D11, BufferD3D11Impl, TextureViewD3D11Impl, PipelineStateD3D11Impl>
+class DeviceContextD3D11Impl final : public DeviceContextBase<IDeviceContextD3D11, BufferD3D11Impl, TextureViewD3D11Impl, PipelineStateD3D11Impl>
{
public:
using TDeviceContextBase = DeviceContextBase<IDeviceContextD3D11, BufferD3D11Impl, TextureViewD3D11Impl, PipelineStateD3D11Impl>;
diff --git a/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h
index 0b84cbae..1faf6e9c 100644
--- a/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h
@@ -38,7 +38,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IFenceD3D11 interface
-class FenceD3D11Impl : public FenceBase<IFenceD3D11, RenderDeviceD3D11Impl>
+class FenceD3D11Impl final : public FenceBase<IFenceD3D11, RenderDeviceD3D11Impl>
{
public:
using TFenceBase = FenceBase<IFenceD3D11, RenderDeviceD3D11Impl>;
diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h
index d52d66f2..2ea2d8da 100644
--- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h
@@ -38,7 +38,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IPipelineStateD3D11 interface
-class PipelineStateD3D11Impl : public PipelineStateBase<IPipelineStateD3D11, RenderDeviceD3D11Impl>
+class PipelineStateD3D11Impl final : public PipelineStateBase<IPipelineStateD3D11, RenderDeviceD3D11Impl>
{
public:
using TPipelineStateBase = PipelineStateBase<IPipelineStateD3D11, RenderDeviceD3D11Impl>;
@@ -79,8 +79,6 @@ public:
return m_SRBMemAllocator;
}
- IShaderVariable* GetDummyShaderVariable(){return &m_DummyShaderVar;}
-
private:
CComPtr<ID3D11BlendState> m_pd3d11BlendState;
CComPtr<ID3D11RasterizerState> m_pd3d11RasterizerState;
@@ -93,8 +91,6 @@ private:
// Do not use strong reference to avoid cyclic references
// Must be declared after the data allocators
std::unique_ptr<class ShaderResourceBindingD3D11Impl, STDDeleter<ShaderResourceBindingD3D11Impl, FixedBlockMemoryAllocator> > m_pDefaultShaderResBinding;
-
- DummyShaderVariable m_DummyShaderVar; ///< Dummy shader variable
};
}
diff --git a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h
index 28f65829..4148577f 100644
--- a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h
@@ -35,7 +35,7 @@ namespace Diligent
{
/// Implementation of the Diligent::IRenderDeviceD3D11 interface
-class RenderDeviceD3D11Impl : public RenderDeviceD3DBase<IRenderDeviceD3D11>
+class RenderDeviceD3D11Impl final : public RenderDeviceD3DBase<IRenderDeviceD3D11>
{
public:
using TRenderDeviceBase = RenderDeviceD3DBase<IRenderDeviceD3D11>;
diff --git a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h
index 58b7250a..35c68720 100644
--- a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h
@@ -36,7 +36,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ISamplerD3D11 interface
-class SamplerD3D11Impl : public SamplerBase<ISamplerD3D11, RenderDeviceD3D11Impl>
+class SamplerD3D11Impl final : public SamplerBase<ISamplerD3D11, RenderDeviceD3D11Impl>
{
public:
using TSamplerBase = SamplerBase<ISamplerD3D11, RenderDeviceD3D11Impl>;
diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h
index 400a5d72..ac84a4a0 100644
--- a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h
@@ -55,15 +55,31 @@ public:
virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject** ppInterface )override final;
- virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override final;
+ virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override final
+ {
+ m_StaticResLayout.BindResources(pResourceMapping, Flags, m_StaticResCache);
+ }
- virtual IShaderVariable* GetShaderVariable( const Char* Name )override final;
+ virtual IShaderVariable* GetShaderVariable( const Char* Name )override final
+ {
+ return m_StaticResLayout.GetShaderVariable(Name);
+ }
- virtual Uint32 GetVariableCount() const override final;
+ virtual Uint32 GetVariableCount() const override final
+ {
+ return m_StaticResLayout.GetTotalResourceCount();
+ }
- virtual IShaderVariable* GetShaderVariable(Uint32 Index)override final;
+ virtual IShaderVariable* GetShaderVariable(Uint32 Index)override final
+ {
+ return m_StaticResLayout.GetShaderVariable(Index);
+ }
- virtual ID3D11DeviceChild* GetD3D11Shader()override final{ return m_pShader; }
+
+ virtual ID3D11DeviceChild* GetD3D11Shader()override final
+ {
+ return m_pShader;
+ }
ID3DBlob* GetBytecode(){return m_pShaderByteCode;}
@@ -72,9 +88,6 @@ public:
Uint32 GetShaderTypeIndex()const{return m_ShaderTypeIndex;}
private:
-
- DummyShaderVariable m_DummyShaderVar; ///< Dummy shader variable
-
/// D3D11 shader
CComPtr<ID3D11DeviceChild> m_pShader;
diff --git a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h
index cc9abd44..f72128cc 100644
--- a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h
@@ -34,7 +34,7 @@ namespace Diligent
class IMemoryAllocator;
/// Implementation of the Diligent::ISwapChainD3D11 interface
-class SwapChainD3D11Impl : public SwapChainD3DBase<ISwapChainD3D11, IDXGISwapChain>
+class SwapChainD3D11Impl final : public SwapChainD3DBase<ISwapChainD3D11, IDXGISwapChain>
{
public:
using TSwapChainBase = SwapChainD3DBase<ISwapChainD3D11, IDXGISwapChain>;
diff --git a/Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h b/Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h
index d089cb42..6dd445c0 100644
--- a/Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h
+++ b/Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h
@@ -32,7 +32,7 @@ namespace Diligent
{
/// Implementation of a 1D texture
-class Texture1D_D3D11 : public TextureBaseD3D11
+class Texture1D_D3D11 final : public TextureBaseD3D11
{
public:
Texture1D_D3D11(IReferenceCounters* pRefCounters,
diff --git a/Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h b/Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h
index fd1f61d6..2108fecb 100644
--- a/Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h
+++ b/Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h
@@ -32,7 +32,7 @@ namespace Diligent
{
/// Implementation of a 2D texture
-class Texture2D_D3D11 : public TextureBaseD3D11
+class Texture2D_D3D11 final : public TextureBaseD3D11
{
public:
Texture2D_D3D11(IReferenceCounters* pRefCounters,
diff --git a/Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h b/Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h
index 8df510f3..e0283cbf 100644
--- a/Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h
+++ b/Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h
@@ -32,7 +32,7 @@ namespace Diligent
{
/// Implementation of a 3D texture
-class Texture3D_D3D11 : public TextureBaseD3D11
+class Texture3D_D3D11 final : public TextureBaseD3D11
{
public:
Texture3D_D3D11(IReferenceCounters* pRefCounters,
diff --git a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h
index 9fcdf352..4c801b07 100644
--- a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ITextureViewD3D11 interface
-class TextureViewD3D11Impl : public TextureViewBase<ITextureViewD3D11, RenderDeviceD3D11Impl>
+class TextureViewD3D11Impl final : public TextureViewBase<ITextureViewD3D11, RenderDeviceD3D11Impl>
{
public:
using TTextureViewBase = TextureViewBase<ITextureViewD3D11, RenderDeviceD3D11Impl>;
diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
index 437df242..a76e4fcf 100644
--- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
@@ -36,8 +36,7 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCoun
const PipelineStateDesc& PipelineDesc) :
TPipelineStateBase(pRefCounters, pRenderDeviceD3D11, PipelineDesc),
m_SRBMemAllocator(GetRawAllocator()),
- m_pDefaultShaderResBinding( nullptr, STDDeleter<ShaderResourceBindingD3D11Impl, FixedBlockMemoryAllocator>(pRenderDeviceD3D11->GetSRBAllocator()) ),
- m_DummyShaderVar(*this)
+ m_pDefaultShaderResBinding( nullptr, STDDeleter<ShaderResourceBindingD3D11Impl, FixedBlockMemoryAllocator>(pRenderDeviceD3D11->GetSRBAllocator()) )
{
if (PipelineDesc.IsComputePipeline)
{
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp
index bc069883..fc428cd0 100644
--- a/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp
@@ -36,8 +36,7 @@ ShaderD3D11Impl::ShaderD3D11Impl(IReferenceCounters* pRefCounters,
TShaderBase(pRefCounters, pRenderDeviceD3D11, CreationAttribs.Desc),
ShaderD3DBase(CreationAttribs),
m_StaticResLayout(*this, GetRawAllocator()),
- m_ShaderTypeIndex(Diligent::GetShaderTypeIndex(CreationAttribs.Desc.ShaderType)),
- m_DummyShaderVar(*this)
+ m_ShaderTypeIndex(Diligent::GetShaderTypeIndex(CreationAttribs.Desc.ShaderType))
{
auto *pDeviceD3D11 = pRenderDeviceD3D11->GetD3D11Device();
switch(CreationAttribs.Desc.ShaderType)
@@ -96,28 +95,4 @@ ShaderD3D11Impl::~ShaderD3D11Impl()
IMPLEMENT_QUERY_INTERFACE( ShaderD3D11Impl, IID_ShaderD3D11, TShaderBase )
-IShaderVariable* ShaderD3D11Impl::GetShaderVariable( const Char* Name )
-{
- auto *pVar = m_StaticResLayout.GetShaderVariable(Name);
- if(pVar == nullptr)
- pVar = &m_DummyShaderVar;
- return pVar;
-}
-
-Uint32 ShaderD3D11Impl::GetVariableCount() const
-{
- return m_StaticResLayout.GetTotalResourceCount();
-}
-
-IShaderVariable* ShaderD3D11Impl::GetShaderVariable(Uint32 Index)
-{
- return m_StaticResLayout.GetShaderVariable(Index);
-}
-
-
-void ShaderD3D11Impl::BindResources(IResourceMapping* pResourceMapping, Uint32 Flags)
-{
- m_StaticResLayout.BindResources(pResourceMapping, Flags, m_StaticResCache);
-}
-
}
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp
index 9ff13e75..433ea149 100644
--- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp
@@ -149,14 +149,7 @@ IShaderVariable* ShaderResourceBindingD3D11Impl::GetVariable(SHADER_TYPE ShaderT
if( Ind >= 0 )
{
auto ResLayoutIndex = m_ResourceLayoutIndex[Ind];
- auto *pVar = m_pResourceLayouts[ResLayoutIndex].GetShaderVariable(Name);
- if(pVar != nullptr)
- return pVar;
- else
- {
- auto *pPSOD3D11 = ValidatedCast<PipelineStateD3D11Impl>(GetPipelineState());
- return pPSOD3D11->GetDummyShaderVariable();
- }
+ return m_pResourceLayouts[ResLayoutIndex].GetShaderVariable(Name);
}
else
{
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp
index 56cc2b70..3d7f549e 100755
--- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp
@@ -752,12 +752,11 @@ void ShaderResourceLayoutD3D11::BindResources( IResourceMapping* pResourceMappin
IShaderVariable* ShaderResourceLayoutD3D11::GetShaderVariable(const Char* Name)
{
- IShaderVariable *pVar = nullptr;
#if USE_VARIABLE_HASH_MAP
// Name will be implicitly converted to HashMapStringKey without making a copy
auto it = m_VariableHash.find( Name );
if( it != m_VariableHash.end() )
- pVar = it->second;
+ return it->second;
#else
for (Uint32 cb = 0; cb < m_NumCBs; ++cb)
if (strcmp(GetCB(cb).Attribs.Name, Name) == 0)
@@ -775,11 +774,8 @@ IShaderVariable* ShaderResourceLayoutD3D11::GetShaderVariable(const Char* Name)
if (strcmp(GetBufUAV(u).Attribs.Name, Name) == 0 )
return &GetBufUAV(u);
#endif
- if(pVar == nullptr)
- {
- LOG_ERROR_MESSAGE( "Unable to find variable \"", Name, "\". Attempts to set the variable will be silently ignored. Note that static variables are accessed through shader objects, while mutable and dynamic variables are accessed through Shader Resource Binding." );
- }
- return pVar;
+
+ return nullptr;
}
Uint32 ShaderResourceLayoutD3D11::GetVariableIndex(const ShaderVariableD3D11Base& Variable)const
diff --git a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h
index b32ddb74..92b668ae 100644
--- a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h
@@ -40,7 +40,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IBufferD3D12 interface
-class BufferD3D12Impl : public BufferBase<IBufferD3D12, RenderDeviceD3D12Impl, BufferViewD3D12Impl, FixedBlockMemoryAllocator>, public D3D12ResourceBase
+class BufferD3D12Impl final : public BufferBase<IBufferD3D12, RenderDeviceD3D12Impl, BufferViewD3D12Impl, FixedBlockMemoryAllocator>, public D3D12ResourceBase
{
public:
using TBufferBase = BufferBase<IBufferD3D12, RenderDeviceD3D12Impl, BufferViewD3D12Impl, FixedBlockMemoryAllocator>;
diff --git a/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h
index a722cdf0..facc688c 100644
--- a/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IBufferViewD3D12 interface
-class BufferViewD3D12Impl : public BufferViewBase<IBufferViewD3D12, RenderDeviceD3D12Impl>
+class BufferViewD3D12Impl final : public BufferViewBase<IBufferViewD3D12, RenderDeviceD3D12Impl>
{
public:
using TBufferViewBase = BufferViewBase<IBufferViewD3D12, RenderDeviceD3D12Impl>;
diff --git a/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h
index 2cb36faf..6ab4bf56 100644
--- a/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h
@@ -33,7 +33,7 @@ namespace Diligent
{
/// Implementation of the Diligent::ICommandList interface
-class CommandListD3D12Impl : public CommandListBase<ICommandList, RenderDeviceD3D12Impl>
+class CommandListD3D12Impl final : public CommandListBase<ICommandList, RenderDeviceD3D12Impl>
{
public:
using TCommandListBase = CommandListBase<ICommandList, RenderDeviceD3D12Impl>;
diff --git a/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h
index d30fa2b4..192210f4 100644
--- a/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h
@@ -33,7 +33,7 @@ namespace Diligent
{
/// Implementation of the Diligent::ICommandQueueD3D12 interface
-class CommandQueueD3D12Impl : public ObjectBase<ICommandQueueD3D12>
+class CommandQueueD3D12Impl final : public ObjectBase<ICommandQueueD3D12>
{
public:
using TBase = ObjectBase<ICommandQueueD3D12>;
diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
index 4c65e1c2..3fd9c1f8 100644
--- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
@@ -40,7 +40,7 @@ namespace Diligent
{
/// Implementation of the Diligent::IDeviceContext interface
-class DeviceContextD3D12Impl : public DeviceContextBase<IDeviceContextD3D12, BufferD3D12Impl, TextureViewD3D12Impl, PipelineStateD3D12Impl>
+class DeviceContextD3D12Impl final : public DeviceContextBase<IDeviceContextD3D12, BufferD3D12Impl, TextureViewD3D12Impl, PipelineStateD3D12Impl>
{
public:
using TDeviceContextBase = DeviceContextBase<IDeviceContextD3D12, BufferD3D12Impl, TextureViewD3D12Impl, PipelineStateD3D12Impl>;
diff --git a/Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h
index 4ab564d4..9a1154e6 100644
--- a/Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IFenceD3D12 interface
-class FenceD3D12Impl : public FenceBase<IFenceD3D12, RenderDeviceD3D12Impl>
+class FenceD3D12Impl final : public FenceBase<IFenceD3D12, RenderDeviceD3D12Impl>
{
public:
using TFenceBase = FenceBase<IFenceD3D12, RenderDeviceD3D12Impl>;
diff --git a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h
index 72d66900..df7a8ff6 100644
--- a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h
@@ -40,7 +40,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IRenderDeviceD3D12 interface
-class PipelineStateD3D12Impl : public PipelineStateBase<IPipelineStateD3D12, RenderDeviceD3D12Impl>
+class PipelineStateD3D12Impl final : public PipelineStateBase<IPipelineStateD3D12, RenderDeviceD3D12Impl>
{
public:
using TPipelineStateBase = PipelineStateBase<IPipelineStateD3D12, RenderDeviceD3D12Impl>;
@@ -78,14 +78,11 @@ public:
return m_SRBMemAllocator;
}
- IShaderVariable *GetDummyShaderVar(){return &m_DummyVar;}
-
private:
/// D3D12 device
CComPtr<ID3D12PipelineState> m_pd3d12PSO;
RootSignature m_RootSig;
- DummyShaderVariable m_DummyVar;
// Must be defined before default SRB
SRBMemoryAllocator m_SRBMemAllocator;
diff --git a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h
index e0e947f9..8e63405e 100644
--- a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h
@@ -41,7 +41,7 @@ namespace Diligent
{
/// Implementation of the Diligent::IRenderDeviceD3D12 interface
-class RenderDeviceD3D12Impl : public RenderDeviceD3DBase<IRenderDeviceD3D12>
+class RenderDeviceD3D12Impl final : public RenderDeviceD3DBase<IRenderDeviceD3D12>
{
public:
using TRenderDeviceBase = RenderDeviceD3DBase<IRenderDeviceD3D12>;
diff --git a/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h
index fb9b7681..f5869058 100644
--- a/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ISamplerD3D12 interface
-class SamplerD3D12Impl : public SamplerBase<ISamplerD3D12, RenderDeviceD3D12Impl>
+class SamplerD3D12Impl final : public SamplerBase<ISamplerD3D12, RenderDeviceD3D12Impl>
{
public:
using TSamplerBase = SamplerBase<ISamplerD3D12, RenderDeviceD3D12Impl>;
diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h
index f70e8d32..ecc26865 100644
--- a/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h
@@ -56,13 +56,25 @@ public:
//virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override;
- virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override;
+ virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override
+ {
+ m_StaticResLayout.BindResources(pResourceMapping, Flags, &m_StaticResCache);
+ }
- virtual IShaderVariable* GetShaderVariable(const Char* Name)override final;
+ virtual IShaderVariable* GetShaderVariable(const Char* Name)override final
+ {
+ return m_StaticResLayout.GetShaderVariable(Name);
+ }
- virtual Uint32 GetVariableCount() const override final;
+ virtual Uint32 GetVariableCount() const override final
+ {
+ return m_StaticResLayout.GetVariableCount();
+ }
- virtual IShaderVariable* GetShaderVariable(Uint32 Index)override final;
+ virtual IShaderVariable* GetShaderVariable(Uint32 Index)override final
+ {
+ return m_StaticResLayout.GetShaderVariable(Index);
+ }
ID3DBlob* GetShaderByteCode(){return m_pShaderByteCode;}
const std::shared_ptr<const ShaderResourcesD3D12>& GetShaderResources()const{return m_pShaderResources;}
@@ -73,9 +85,6 @@ public:
#endif
private:
-
- DummyShaderVariable m_DummyShaderVar; ///< Dummy shader variable
-
// ShaderResources class instance must be referenced through the shared pointer, because
// it is referenced by ShaderResourceLayoutD3D12 class instances
std::shared_ptr<const ShaderResourcesD3D12> m_pShaderResources;
diff --git a/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h
index 30153804..eca54318 100644
--- a/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h
@@ -36,7 +36,7 @@ namespace Diligent
class ITextureViewD3D12;
class IMemoryAllocator;
/// Implementation of the Diligent::ISwapChainD3D12 interface
-class SwapChainD3D12Impl : public SwapChainD3DBase<ISwapChainD3D12, IDXGISwapChain3>
+class SwapChainD3D12Impl final : public SwapChainD3DBase<ISwapChainD3D12, IDXGISwapChain3>
{
public:
using TSwapChainBase = SwapChainD3DBase<ISwapChainD3D12, IDXGISwapChain3>;
diff --git a/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h
index 81353c01..65f0d493 100644
--- a/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h
@@ -39,7 +39,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Base implementation of the Diligent::ITextureD3D12 interface
-class TextureD3D12Impl : public TextureBase<ITextureD3D12, RenderDeviceD3D12Impl, TextureViewD3D12Impl, FixedBlockMemoryAllocator>, public D3D12ResourceBase
+class TextureD3D12Impl final : public TextureBase<ITextureD3D12, RenderDeviceD3D12Impl, TextureViewD3D12Impl, FixedBlockMemoryAllocator>, public D3D12ResourceBase
{
public:
using TTextureBase = TextureBase<ITextureD3D12, RenderDeviceD3D12Impl, TextureViewD3D12Impl, FixedBlockMemoryAllocator>;
diff --git a/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h
index b220dde8..444c32c6 100644
--- a/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ITextureViewD3D12 interface
-class TextureViewD3D12Impl : public TextureViewBase<ITextureViewD3D12, RenderDeviceD3D12Impl>
+class TextureViewD3D12Impl final : public TextureViewBase<ITextureViewD3D12, RenderDeviceD3D12Impl>
{
public:
using TTextureViewBase = TextureViewBase<ITextureViewD3D12, RenderDeviceD3D12Impl>;
diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
index 9f1f2324..55771a03 100644
--- a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
@@ -63,7 +63,6 @@ PipelineStateD3D12Impl :: PipelineStateD3D12Impl(IReferenceCounters* pRefCo
RenderDeviceD3D12Impl* pDeviceD3D12,
const PipelineStateDesc& PipelineDesc) :
TPipelineStateBase(pRefCounters, pDeviceD3D12, PipelineDesc),
- m_DummyVar(*this),
m_SRBMemAllocator(GetRawAllocator()),
m_pDefaultShaderResBinding(nullptr, STDDeleter<ShaderResourceBindingD3D12Impl, FixedBlockMemoryAllocator>(pDeviceD3D12->GetSRBAllocator()) )
{
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
index d92e4e14..f03d194d 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
@@ -42,7 +42,6 @@ ShaderD3D12Impl::ShaderD3D12Impl(IReferenceCounters* pRefCounters,
TShaderBase(pRefCounters, pRenderDeviceD3D12, ShaderCreationAttribs.Desc),
ShaderD3DBase(ShaderCreationAttribs),
m_StaticResLayout(*this, GetRawAllocator()),
- m_DummyShaderVar(*this),
m_StaticResCache(ShaderResourceCacheD3D12::DbgCacheContentType::StaticShaderResources)
{
// Load shader resources
@@ -61,29 +60,6 @@ ShaderD3D12Impl::~ShaderD3D12Impl()
{
}
-void ShaderD3D12Impl::BindResources(IResourceMapping* pResourceMapping, Uint32 Flags)
-{
- m_StaticResLayout.BindResources(pResourceMapping, Flags, &m_StaticResCache);
-}
-
-IShaderVariable* ShaderD3D12Impl::GetShaderVariable(const Char* Name)
-{
- auto *pVar = m_StaticResLayout.GetShaderVariable(Name);
- if(pVar == nullptr)
- pVar = &m_DummyShaderVar;
- return pVar;
-}
-
-Uint32 ShaderD3D12Impl::GetVariableCount()const
-{
- return m_StaticResLayout.GetVariableCount();
-}
-
-IShaderVariable* ShaderD3D12Impl::GetShaderVariable(Uint32 Index)
-{
- return m_StaticResLayout.GetShaderVariable(Index);
-}
-
#ifdef VERIFY_SHADER_BINDINGS
void ShaderD3D12Impl::DbgVerifyStaticResourceBindings()
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp
index 0d15ef8b..8c70ae89 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp
@@ -92,13 +92,9 @@ IShaderVariable *ShaderResourceBindingD3D12Impl::GetVariable(SHADER_TYPE ShaderT
if (ResLayoutInd < 0)
{
LOG_ERROR("Failed to find shader variable \"", Name,"\" in shader resource binding: shader type ", GetShaderTypeLiteralName(ShaderType), " is not initialized");
- return ValidatedCast<PipelineStateD3D12Impl>(GetPipelineState())->GetDummyShaderVar();
+ return nullptr;
}
- auto* pVar = m_pResourceLayouts[ResLayoutInd].GetShaderVariable(Name);
- if(pVar == nullptr)
- pVar = ValidatedCast<PipelineStateD3D12Impl>(GetPipelineState())->GetDummyShaderVar();
-
- return pVar;
+ return m_pResourceLayouts[ResLayoutInd].GetShaderVariable(Name);
}
Uint32 ShaderResourceBindingD3D12Impl::GetVariableCount(SHADER_TYPE ShaderType) const
@@ -121,7 +117,7 @@ IShaderVariable* ShaderResourceBindingD3D12Impl::GetVariable(SHADER_TYPE ShaderT
if (ResLayoutInd < 0)
{
LOG_ERROR("Failed to find shader variable at index ", Index, " in shader resource binding: shader type ", GetShaderTypeLiteralName(ShaderType), " is not initialized");
- return ValidatedCast<PipelineStateD3D12Impl>(GetPipelineState())->GetDummyShaderVar();
+ return nullptr;
}
return m_pResourceLayouts[ResLayoutInd].GetShaderVariable(Index);
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
index 70f9c74e..ddba7731 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
@@ -855,30 +855,22 @@ void ShaderResourceLayoutD3D12::BindResources(IResourceMapping* pR
IShaderVariable* ShaderResourceLayoutD3D12::GetShaderVariable(const Char* Name)
{
- IShaderVariable* pVar = nullptr;
#if USE_VARIABLE_HASH_MAP
// Name will be implicitly converted to HashMapStringKey without making a copy
auto it = m_VariableHash.find( Name );
if( it != m_VariableHash.end() )
- pVar = it->second;
+ return it->second;
#else
Uint32 TotalResources = GetTotalSrvCbvUavCount();
- for(Uint32 r=0; r < TotalResources; ++r)
+ for (Uint32 r=0; r < TotalResources; ++r)
{
auto &Res = GetSrvCbvUav(r);
if (strcmp(Res.Attribs.Name, Name) == 0)
- {
- pVar = &Res;
- break;
- }
+ return &Res;
}
#endif
- if(pVar == nullptr)
- {
- LOG_ERROR_MESSAGE( "Shader variable \"", Name, "\" is not found in shader \"", GetShaderName(), "\" (", GetShaderTypeLiteralName(m_pResources->GetShaderType()), "). Attempts to set the variable will be silently ignored." );
- }
- return pVar;
+ return nullptr;
}
IShaderVariable* ShaderResourceLayoutD3D12::GetShaderVariable( Uint32 Index )
diff --git a/Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h
index 69b6d7f9..1d990493 100644
--- a/Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IBufferGL interface
-class BufferGLImpl : public BufferBase<IBufferGL, RenderDeviceGLImpl, BufferViewGLImpl, FixedBlockMemoryAllocator>, public AsyncWritableResource
+class BufferGLImpl final : public BufferBase<IBufferGL, RenderDeviceGLImpl, BufferViewGLImpl, FixedBlockMemoryAllocator>, public AsyncWritableResource
{
public:
using TBufferBase = BufferBase<IBufferGL, RenderDeviceGLImpl, BufferViewGLImpl, FixedBlockMemoryAllocator>;
diff --git a/Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h
index f30e44b7..4d86e21f 100644
--- a/Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h
@@ -40,7 +40,7 @@ class BufferGLImpl;
struct BufferViewDesc;
/// Implementation of the Diligent::IBufferViewGL interface
-class BufferViewGLImpl : public BufferViewBase<IBufferViewGL, RenderDeviceGLImpl>
+class BufferViewGLImpl final : public BufferViewBase<IBufferViewGL, RenderDeviceGLImpl>
{
public:
using TBuffViewBase = BufferViewBase<IBufferViewGL, RenderDeviceGLImpl>;
diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
index 6967f15a..a33ff3a3 100644
--- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
@@ -36,7 +36,7 @@ namespace Diligent
{
/// Implementation of the Diligent::IDeviceContextGL interface
-class DeviceContextGLImpl : public DeviceContextBase<IDeviceContextGL, BufferGLImpl, TextureViewGLImpl, PipelineStateGLImpl>
+class DeviceContextGLImpl final : public DeviceContextBase<IDeviceContextGL, BufferGLImpl, TextureViewGLImpl, PipelineStateGLImpl>
{
public:
using TDeviceContextBase = DeviceContextBase<IDeviceContextGL, BufferGLImpl, TextureViewGLImpl, PipelineStateGLImpl>;
diff --git a/Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h
index a87e8eb1..e6f4423a 100644
--- a/Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/FenceGLImpl.h
@@ -39,7 +39,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IFenceGL interface
-class FenceGLImpl : public FenceBase<IFenceGL, RenderDeviceGLImpl>
+class FenceGLImpl final : public FenceBase<IFenceGL, RenderDeviceGLImpl>
{
public:
using TFenceBase = FenceBase<IFenceGL, RenderDeviceGLImpl>;
diff --git a/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h
index 6730e89e..c6f54964 100644
--- a/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IPipelineStateGL interface
-class PipelineStateGLImpl : public PipelineStateBase<IPipelineStateGL, RenderDeviceGLImpl>
+class PipelineStateGLImpl final : public PipelineStateBase<IPipelineStateGL, RenderDeviceGLImpl>
{
public:
using TPipelineStateBase = PipelineStateBase<IPipelineStateGL, RenderDeviceGLImpl>;
diff --git a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLESImpl.h b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLESImpl.h
index 973e31b9..b34ebeaa 100644
--- a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLESImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLESImpl.h
@@ -28,7 +28,7 @@
namespace Diligent
{
-class RenderDeviceGLESImpl : public RenderDeviceGLImpl
+class RenderDeviceGLESImpl final : public RenderDeviceGLImpl
{
public:
RenderDeviceGLESImpl( IReferenceCounters *pRefCounters, IMemoryAllocator &RawMemAllocator, const EngineGLAttribs &InitAttribs );
diff --git a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h
index adb0f833..3f93f22d 100644
--- a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h
@@ -49,6 +49,7 @@ namespace Diligent
{
/// Implementation of the render device interface in OpenGL
+// RenderDeviceGLESImpl is inherited from RenderDeviceGLImpl
class RenderDeviceGLImpl : public RenderDeviceBase<IGLDeviceBaseInterface>
{
public:
diff --git a/Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h
index b2b33392..ad9a9c5b 100644
--- a/Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h
@@ -35,7 +35,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ISamplerGL interface
-class SamplerGLImpl : public SamplerBase<ISamplerGL, RenderDeviceGLImpl>
+class SamplerGLImpl final : public SamplerBase<ISamplerGL, RenderDeviceGLImpl>
{
public:
using TSamplerBase = SamplerBase<ISamplerGL, RenderDeviceGLImpl>;
diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h
index 533eee32..6500ad29 100644
--- a/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h
@@ -59,7 +59,6 @@ public:
private:
GLProgramResources m_DynamicProgResources[6];
- DummyShaderVariable m_DummyShaderVar; ///< Dummy shader variable
RefCntWeakPtr<PipelineStateGLImpl> m_wpPSO;
};
diff --git a/Graphics/GraphicsEngineOpenGL/include/Texture1DArray_OGL.h b/Graphics/GraphicsEngineOpenGL/include/Texture1DArray_OGL.h
index 186a8ff5..b0fc149f 100644
--- a/Graphics/GraphicsEngineOpenGL/include/Texture1DArray_OGL.h
+++ b/Graphics/GraphicsEngineOpenGL/include/Texture1DArray_OGL.h
@@ -28,7 +28,7 @@
namespace Diligent
{
-class Texture1DArray_OGL : public TextureBaseGL
+class Texture1DArray_OGL final : public TextureBaseGL
{
public:
Texture1DArray_OGL( IReferenceCounters *pRefCounters,
diff --git a/Graphics/GraphicsEngineOpenGL/include/Texture1D_OGL.h b/Graphics/GraphicsEngineOpenGL/include/Texture1D_OGL.h
index ac9dd25a..7db891f6 100644
--- a/Graphics/GraphicsEngineOpenGL/include/Texture1D_OGL.h
+++ b/Graphics/GraphicsEngineOpenGL/include/Texture1D_OGL.h
@@ -28,7 +28,7 @@
namespace Diligent
{
-class Texture1D_OGL : public TextureBaseGL
+class Texture1D_OGL final : public TextureBaseGL
{
public:
Texture1D_OGL( IReferenceCounters *pRefCounters,
diff --git a/Graphics/GraphicsEngineOpenGL/include/Texture2DArray_OGL.h b/Graphics/GraphicsEngineOpenGL/include/Texture2DArray_OGL.h
index 86262eab..ff2ec974 100644
--- a/Graphics/GraphicsEngineOpenGL/include/Texture2DArray_OGL.h
+++ b/Graphics/GraphicsEngineOpenGL/include/Texture2DArray_OGL.h
@@ -28,7 +28,7 @@
namespace Diligent
{
-class Texture2DArray_OGL : public TextureBaseGL
+class Texture2DArray_OGL final : public TextureBaseGL
{
public:
Texture2DArray_OGL( IReferenceCounters *pRefCounters,
diff --git a/Graphics/GraphicsEngineOpenGL/include/Texture2D_OGL.h b/Graphics/GraphicsEngineOpenGL/include/Texture2D_OGL.h
index ac828b89..af64a86a 100644
--- a/Graphics/GraphicsEngineOpenGL/include/Texture2D_OGL.h
+++ b/Graphics/GraphicsEngineOpenGL/include/Texture2D_OGL.h
@@ -28,7 +28,7 @@
namespace Diligent
{
-class Texture2D_OGL : public TextureBaseGL
+class Texture2D_OGL final : public TextureBaseGL
{
public:
Texture2D_OGL( IReferenceCounters *pRefCounters,
diff --git a/Graphics/GraphicsEngineOpenGL/include/Texture3D_OGL.h b/Graphics/GraphicsEngineOpenGL/include/Texture3D_OGL.h
index f7640d5f..5e4ebcec 100644
--- a/Graphics/GraphicsEngineOpenGL/include/Texture3D_OGL.h
+++ b/Graphics/GraphicsEngineOpenGL/include/Texture3D_OGL.h
@@ -28,7 +28,7 @@
namespace Diligent
{
-class Texture3D_OGL : public TextureBaseGL
+class Texture3D_OGL final : public TextureBaseGL
{
public:
Texture3D_OGL( IReferenceCounters *pRefCounters,
diff --git a/Graphics/GraphicsEngineOpenGL/include/TextureCubeArray_OGL.h b/Graphics/GraphicsEngineOpenGL/include/TextureCubeArray_OGL.h
index cad44e71..e76ea064 100644
--- a/Graphics/GraphicsEngineOpenGL/include/TextureCubeArray_OGL.h
+++ b/Graphics/GraphicsEngineOpenGL/include/TextureCubeArray_OGL.h
@@ -28,7 +28,7 @@
namespace Diligent
{
-class TextureCubeArray_OGL : public TextureBaseGL
+class TextureCubeArray_OGL final : public TextureBaseGL
{
public:
TextureCubeArray_OGL( IReferenceCounters *pRefCounters,
diff --git a/Graphics/GraphicsEngineOpenGL/include/TextureCube_OGL.h b/Graphics/GraphicsEngineOpenGL/include/TextureCube_OGL.h
index 05921b01..a4536847 100644
--- a/Graphics/GraphicsEngineOpenGL/include/TextureCube_OGL.h
+++ b/Graphics/GraphicsEngineOpenGL/include/TextureCube_OGL.h
@@ -28,7 +28,7 @@
namespace Diligent
{
-class TextureCube_OGL : public TextureBaseGL
+class TextureCube_OGL final : public TextureBaseGL
{
public:
TextureCube_OGL( IReferenceCounters *pRefCounters,
diff --git a/Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h
index 3bff9a36..7f9a16c6 100644
--- a/Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h
@@ -35,7 +35,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ITextureViewGL interface
-class TextureViewGLImpl : public TextureViewBase<ITextureViewGL, RenderDeviceGLImpl>
+class TextureViewGLImpl final : public TextureViewBase<ITextureViewGL, RenderDeviceGLImpl>
{
public:
using TTextureViewBase = TextureViewBase<ITextureViewGL, RenderDeviceGLImpl>;
diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
index c73705c1..1a3ebfda 100644
--- a/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
@@ -194,13 +194,7 @@ IShaderVariable* ShaderGLImpl::GetShaderVariable( const Char* Name )
UNSUPPORTED( "Shader variable queries are currently supported for separable programs only" );
}
- auto *pShaderVar = m_GlProgObj.GetConstantResources().GetShaderVariable(Name);
- if(!pShaderVar)
- {
- LOG_ERROR_MESSAGE( "Static shader variable \"", Name, "\" is not found in shader \"", m_Desc.Name ? m_Desc.Name : "", "\". Attempts to set the variable will be silently ignored." );
- pShaderVar = &m_DummyShaderVar;
- }
- return pShaderVar;
+ return m_GlProgObj.GetConstantResources().GetShaderVariable(Name);
}
Uint32 ShaderGLImpl::GetVariableCount() const
diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
index 2774295b..3d2b7198 100644
--- a/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
@@ -32,7 +32,6 @@ namespace Diligent
ShaderResourceBindingGLImpl::ShaderResourceBindingGLImpl( IReferenceCounters *pRefCounters, PipelineStateGLImpl *pPSO) :
TBase( pRefCounters, pPSO ),
- m_DummyShaderVar(*this),
m_wpPSO(pPSO)
{
SHADER_VARIABLE_TYPE VarTypes[] = {SHADER_VARIABLE_TYPE_MUTABLE, SHADER_VARIABLE_TYPE_DYNAMIC};
@@ -85,13 +84,7 @@ void ShaderResourceBindingGLImpl::BindResources(Uint32 ShaderFlags, IResourceMap
IShaderVariable *ShaderResourceBindingGLImpl::GetVariable(SHADER_TYPE ShaderType, const char *Name)
{
auto ShaderInd = GetShaderTypeIndex(ShaderType);
- IShaderVariable *pVar = m_DynamicProgResources[ShaderInd].GetShaderVariable(Name);
- if( !pVar )
- {
- LOG_ERROR_MESSAGE( "Shader variable \"", Name, "\" is not found in the shader resource mapping. Attempts to set the variable will be silently ignored." );
- pVar = &m_DummyShaderVar;
- }
- return pVar;
+ return m_DynamicProgResources[ShaderInd].GetShaderVariable(Name);
}
Uint32 ShaderResourceBindingGLImpl::GetVariableCount(SHADER_TYPE ShaderType) const
diff --git a/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h b/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h
index 1108597d..ca57e3e8 100644
--- a/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h
@@ -39,7 +39,7 @@ class FixedBlockMemoryAllocator;
class BufferVkImpl;
/// Implementation of the Diligent::IBufferViewVk interface
-class BufferViewVkImpl : public BufferViewBase<IBufferViewVk, RenderDeviceVkImpl>
+class BufferViewVkImpl final : public BufferViewBase<IBufferViewVk, RenderDeviceVkImpl>
{
public:
using TBufferViewBase = BufferViewBase<IBufferViewVk, RenderDeviceVkImpl>;
diff --git a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h
index 90148d2b..72b5e217 100644
--- a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h
@@ -44,7 +44,7 @@ class FixedBlockMemoryAllocator;
class DeviceContextVkImpl;
/// Implementation of the Diligent::IBufferVk interface
-class BufferVkImpl : public BufferBase<IBufferVk, RenderDeviceVkImpl, BufferViewVkImpl, FixedBlockMemoryAllocator>
+class BufferVkImpl final : public BufferBase<IBufferVk, RenderDeviceVkImpl, BufferViewVkImpl, FixedBlockMemoryAllocator>
{
public:
using TBufferBase = BufferBase<IBufferVk, RenderDeviceVkImpl, BufferViewVkImpl, FixedBlockMemoryAllocator>;
diff --git a/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h b/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h
index 19051478..b64f32bb 100644
--- a/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h
@@ -34,7 +34,7 @@ namespace Diligent
{
/// Implementation of the Diligent::ICommandList interface
-class CommandListVkImpl : public CommandListBase<ICommandList, RenderDeviceVkImpl>
+class CommandListVkImpl final : public CommandListBase<ICommandList, RenderDeviceVkImpl>
{
public:
using TCommandListBase = CommandListBase<ICommandList, RenderDeviceVkImpl>;
diff --git a/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h b/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h
index 8e2bb941..5e31bf01 100644
--- a/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h
@@ -38,7 +38,7 @@ namespace Diligent
{
/// Implementation of the Diligent::ICommandQueueVk interface
-class CommandQueueVkImpl : public ObjectBase<ICommandQueueVk>
+class CommandQueueVkImpl final : public ObjectBase<ICommandQueueVk>
{
public:
using TBase = ObjectBase<ICommandQueueVk>;
diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
index 94c0a3c8..9b8ad516 100644
--- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
@@ -45,7 +45,7 @@ namespace Diligent
{
/// Implementation of the Diligent::IDeviceContext interface
-class DeviceContextVkImpl : public DeviceContextBase<IDeviceContextVk, BufferVkImpl, TextureViewVkImpl, PipelineStateVkImpl>
+class DeviceContextVkImpl final : public DeviceContextBase<IDeviceContextVk, BufferVkImpl, TextureViewVkImpl, PipelineStateVkImpl>
{
public:
using TDeviceContextBase = DeviceContextBase<IDeviceContextVk, BufferVkImpl, TextureViewVkImpl, PipelineStateVkImpl>;
diff --git a/Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h b/Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h
index 7883d268..d1cb588d 100644
--- a/Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h
@@ -38,7 +38,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IFenceVk interface
-class FenceVkImpl : public FenceBase<IFenceVk, RenderDeviceVkImpl>
+class FenceVkImpl final : public FenceBase<IFenceVk, RenderDeviceVkImpl>
{
public:
using TFenceBase = FenceBase<IFenceVk, RenderDeviceVkImpl>;
diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
index bb5bdd3f..1475c9ff 100644
--- a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
@@ -46,7 +46,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IRenderDeviceVk interface
-class PipelineStateVkImpl : public PipelineStateBase<IPipelineStateVk, RenderDeviceVkImpl>
+class PipelineStateVkImpl final : public PipelineStateBase<IPipelineStateVk, RenderDeviceVkImpl>
{
public:
using TPipelineStateBase = PipelineStateBase<IPipelineStateVk, RenderDeviceVkImpl>;
@@ -88,9 +88,7 @@ public:
{
return m_SRBMemAllocator;
}
-
- IShaderVariable *GetDummyShaderVar(){return &m_DummyVar;}
-
+
static VkRenderPassCreateInfo GetRenderPassCreateInfo(Uint32 NumRenderTargets,
const TEXTURE_FORMAT RTVFormats[],
TEXTURE_FORMAT DSVFormat,
@@ -101,9 +99,6 @@ public:
private:
-
- DummyShaderVariable m_DummyVar;
-
ShaderResourceLayoutVk* m_ShaderResourceLayouts = nullptr;
// SRB memory allocator must be declared before m_pDefaultShaderResBinding
diff --git a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h
index 5dc4514d..227526b2 100644
--- a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h
@@ -51,7 +51,7 @@ namespace Diligent
{
/// Implementation of the Diligent::IRenderDeviceVk interface
-class RenderDeviceVkImpl : public RenderDeviceBase<IRenderDeviceVk>
+class RenderDeviceVkImpl final : public RenderDeviceBase<IRenderDeviceVk>
{
public:
using TRenderDeviceBase = RenderDeviceBase<IRenderDeviceVk>;
diff --git a/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h b/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h
index 290ce87c..d8adb0a9 100644
--- a/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ISamplerVk interface
-class SamplerVkImpl : public SamplerBase<ISamplerVk, RenderDeviceVkImpl>
+class SamplerVkImpl final : public SamplerBase<ISamplerVk, RenderDeviceVkImpl>
{
public:
using TSamplerBase = SamplerBase<ISamplerVk, RenderDeviceVkImpl>;
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h
index 9daeb665..f2febb53 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h
@@ -51,13 +51,25 @@ public:
//virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override;
- virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override;
-
- virtual IShaderVariable* GetShaderVariable(const Char* Name)override;
+ virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override
+ {
+ m_StaticVarsMgr.BindResources(pResourceMapping, Flags);
+ }
+
+ virtual IShaderVariable* GetShaderVariable(const Char* Name)override
+ {
+ return m_StaticVarsMgr.GetVariable(Name);
+ }
- virtual Uint32 GetVariableCount() const override final;
+ virtual Uint32 GetVariableCount() const override final
+ {
+ return m_StaticVarsMgr.GetVariableCount();
+ }
- virtual IShaderVariable* GetShaderVariable(Uint32 Index)override final;
+ virtual IShaderVariable* GetShaderVariable(Uint32 Index)override final
+ {
+ return m_StaticVarsMgr.GetVariable(Index);
+ }
virtual const std::vector<uint32_t>& GetSPIRV()const override final
{
@@ -73,9 +85,6 @@ public:
#endif
private:
-
- DummyShaderVariable m_DummyShaderVar; ///< Dummy shader variable
-
// ShaderResources class instance must be referenced through the shared pointer, because
// it is referenced by ShaderResourceLayoutVk class instances
std::shared_ptr<const SPIRVShaderResources> m_pShaderResources;
diff --git a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
index dcb62ab5..9c448ce1 100644
--- a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
@@ -37,7 +37,7 @@ namespace Diligent
class ITextureViewVk;
class IMemoryAllocator;
/// Implementation of the Diligent::ISwapChainVk interface
-class SwapChainVkImpl : public SwapChainBase<ISwapChainVk>
+class SwapChainVkImpl final : public SwapChainBase<ISwapChainVk>
{
public:
using TSwapChainBase = SwapChainBase<ISwapChainVk>;
diff --git a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
index 4d283d51..467a2241 100644
--- a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::ITextureViewVk interface
-class TextureViewVkImpl : public TextureViewBase<ITextureViewVk, RenderDeviceVkImpl>
+class TextureViewVkImpl final : public TextureViewBase<ITextureViewVk, RenderDeviceVkImpl>
{
public:
using TTextureViewBase = TextureViewBase<ITextureViewVk, RenderDeviceVkImpl>;
diff --git a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
index b027710a..eee1a938 100644
--- a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
@@ -39,7 +39,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Base implementation of the Diligent::ITextureVk interface
-class TextureVkImpl : public TextureBase<ITextureVk, RenderDeviceVkImpl, TextureViewVkImpl, FixedBlockMemoryAllocator>
+class TextureVkImpl final : public TextureBase<ITextureVk, RenderDeviceVkImpl, TextureViewVkImpl, FixedBlockMemoryAllocator>
{
public:
using TTextureBase = TextureBase<ITextureVk, RenderDeviceVkImpl, TextureViewVkImpl, FixedBlockMemoryAllocator>;
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
index 399adcbc..f379d25f 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
@@ -130,7 +130,6 @@ PipelineStateVkImpl :: PipelineStateVkImpl(IReferenceCounters* pRefCounters
RenderDeviceVkImpl* pDeviceVk,
const PipelineStateDesc& PipelineDesc) :
TPipelineStateBase(pRefCounters, pDeviceVk, PipelineDesc),
- m_DummyVar(*this),
m_SRBMemAllocator(GetRawAllocator()),
m_pDefaultShaderResBinding(nullptr, STDDeleter<ShaderResourceBindingVkImpl, FixedBlockMemoryAllocator>(pDeviceVk->GetSRBAllocator()) )
{
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
index 0d13319e..f91eea9b 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
@@ -108,19 +108,9 @@ IShaderVariable* ShaderResourceBindingVkImpl::GetVariable(SHADER_TYPE ShaderType
if (ResLayoutInd < 0)
{
LOG_ERROR("Failed to find variable \"", Name,"\" in shader resource binding: shader type ", GetShaderTypeLiteralName(ShaderType), " is not initialized");
- return ValidatedCast<PipelineStateVkImpl>(GetPipelineState())->GetDummyShaderVar();
- }
- auto *pVar = m_pShaderVarMgrs[ResLayoutInd].GetVariable(Name);
- if(pVar == nullptr)
- {
- LOG_ERROR("Failed to find variable \"", Name,"\" in shader resource binding. Note that only dynamic and mutable variables can be accessed through SRB object.");
- return ValidatedCast<PipelineStateVkImpl>(GetPipelineState())->GetDummyShaderVar();
- }
- else
- {
- VERIFY(pVar->GetResource().SpirvAttribs.VarType != SHADER_VARIABLE_TYPE_STATIC, "Static variables cannot be accessed through shader resource binding");
- return pVar;
+ return nullptr;
}
+ return m_pShaderVarMgrs[ResLayoutInd].GetVariable(Name);
}
Uint32 ShaderResourceBindingVkImpl::GetVariableCount(SHADER_TYPE ShaderType) const
@@ -142,7 +132,7 @@ IShaderVariable* ShaderResourceBindingVkImpl::GetVariable(SHADER_TYPE ShaderType
if (ResLayoutInd < 0)
{
LOG_ERROR("Failed to find variable at index \"", Index, "\" in shader resource binding: shader type ", GetShaderTypeLiteralName(ShaderType), " is not initialized");
- return ValidatedCast<PipelineStateVkImpl>(GetPipelineState())->GetDummyShaderVar();
+ return nullptr;
}
return m_pShaderVarMgrs[ResLayoutInd].GetVariable(Index);
}
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
index 0db36dee..8117aa30 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
@@ -38,7 +38,6 @@ namespace Diligent
ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* pRenderDeviceVk, const ShaderCreationAttribs& CreationAttribs) :
TShaderBase(pRefCounters, pRenderDeviceVk, CreationAttribs.Desc),
- m_DummyShaderVar(*this),
m_StaticResLayout(*this, pRenderDeviceVk->GetLogicalDevice(), GetRawAllocator()),
m_StaticResCache(ShaderResourceCacheVk::DbgCacheContentType::StaticShaderResources),
m_StaticVarsMgr(*this)
@@ -69,34 +68,6 @@ ShaderVkImpl::~ShaderVkImpl()
m_StaticVarsMgr.Destroy(GetRawAllocator());
}
-void ShaderVkImpl::BindResources(IResourceMapping* pResourceMapping, Uint32 Flags)
-{
- m_StaticVarsMgr.BindResources(pResourceMapping, Flags);
-}
-
-IShaderVariable* ShaderVkImpl::GetShaderVariable(const Char* Name)
-{
- IShaderVariable *pVar = m_StaticVarsMgr.GetVariable(Name);
- if (pVar == nullptr)
- {
- LOG_ERROR_MESSAGE("Shader variable \"", Name, "\" is not found in shader \"", m_Desc.Name, "\". Note that only static variables can be accessed through shader object.");
- return &m_DummyShaderVar;
- }
- else
- return pVar;
-}
-
-Uint32 ShaderVkImpl::GetVariableCount()const
-{
- return m_StaticVarsMgr.GetVariableCount();
-}
-
-IShaderVariable* ShaderVkImpl::GetShaderVariable(Uint32 Index)
-{
- return m_StaticVarsMgr.GetVariable(Index);
-}
-
-
#ifdef DEVELOPMENT
void ShaderVkImpl::DvpVerifyStaticResourceBindings()
{