summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
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/GraphicsEngineOpenGL
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/GraphicsEngineOpenGL')
-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
19 files changed, 18 insertions, 31 deletions
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