summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-03 09:08:53 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-03 09:08:53 +0000
commit6585bec7cae42818f633b248c5b42b8355e02283 (patch)
tree56b73a3e3e883b8ed2223efd915c6e91a2632bef /Graphics/GraphicsEngineOpenGL
parentCouple fixes to Vulkan upload heap (diff)
downloadDiligentCore-6585bec7cae42818f633b248c5b42b8355e02283.tar.gz
DiligentCore-6585bec7cae42818f633b248c5b42b8355e02283.zip
Implemented shader variable access by index;
Fixed issues with UAV binding in D3D11; Improved shader resource layout in D3D12
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h21
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h12
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h12
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp12
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp12
5 files changed, 61 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h b/Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h
index 3989f4cd..2d01c261 100644
--- a/Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h
+++ b/Graphics/GraphicsEngineOpenGL/include/GLProgramResources.h
@@ -194,6 +194,27 @@ namespace Diligent
ProgramVar.pResources[FirstElement + i] = ppObjects[i];
}
+ virtual SHADER_VARIABLE_TYPE GetType()const override final
+ {
+ return ProgramVar.VarType;
+ }
+
+ virtual Uint32 GetArraySize()const override final
+ {
+ return static_cast<Uint32>(ProgramVar.pResources.size());
+ }
+
+ virtual const Char* GetName()const override final
+ {
+ return ProgramVar.Name.c_str();
+ }
+
+ virtual Uint32 GetIndex()const override final
+ {
+ UNSUPPORTED("Not yet implemented");
+ return 0;
+ }
+
private:
GLProgramVariableBase &ProgramVar;
};
diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h
index cfdad4fd..a4d1aa05 100644
--- a/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h
@@ -65,7 +65,7 @@ inline GLenum ShaderTypeToGLShaderBit(SHADER_TYPE ShaderType)
}
/// Implementation of the Diligent::IShaderGL interface
-class ShaderGLImpl : public ShaderBase<IShaderGL, RenderDeviceGLImpl>
+class ShaderGLImpl final : public ShaderBase<IShaderGL, RenderDeviceGLImpl>
{
public:
using TShaderBase = ShaderBase<IShaderGL, RenderDeviceGLImpl>;
@@ -73,11 +73,15 @@ public:
ShaderGLImpl( IReferenceCounters *pRefCounters, RenderDeviceGLImpl *pDeviceGL, const ShaderCreationAttribs &ShaderCreationAttribs, bool bIsDeviceInternal = false );
~ShaderGLImpl();
- virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override;
+ virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override final;
- virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override;
+ virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final;
- virtual IShaderVariable* GetShaderVariable( const Char* Name )override;
+ virtual IShaderVariable* GetShaderVariable( const Char* Name )override final;
+
+ virtual Uint32 GetVariableCount() const override final;
+
+ virtual IShaderVariable* GetShaderVariable(Uint32 Index) override final;
GLProgram& GetGlProgram(){return m_GlProgObj;}
diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h
index 61b9d013..533eee32 100644
--- a/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h
@@ -37,7 +37,7 @@ namespace Diligent
class FixedBlockMemoryAllocator;
/// Implementation of the Diligent::IShaderResourceBindingGL interface
-class ShaderResourceBindingGLImpl : public ShaderResourceBindingBase<IShaderResourceBindingGL>
+class ShaderResourceBindingGLImpl final : public ShaderResourceBindingBase<IShaderResourceBindingGL>
{
public:
using TBase = ShaderResourceBindingBase<IShaderResourceBindingGL>;
@@ -45,11 +45,15 @@ public:
ShaderResourceBindingGLImpl(IReferenceCounters *pRefCounters, class PipelineStateGLImpl *pPSO);
~ShaderResourceBindingGLImpl();
- virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override;
+ virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final;
- virtual void BindResources(Uint32 ShaderFlags, IResourceMapping *pResMapping, Uint32 Flags)override;
+ virtual void BindResources(Uint32 ShaderFlags, IResourceMapping *pResMapping, Uint32 Flags)override final;
- virtual IShaderVariable *GetVariable(SHADER_TYPE ShaderType, const char *Name)override;
+ virtual IShaderVariable* GetVariable(SHADER_TYPE ShaderType, const char *Name)override final;
+
+ virtual Uint32 GetVariableCount(SHADER_TYPE ShaderType) const override final;
+
+ virtual IShaderVariable* GetVariable(SHADER_TYPE ShaderType, Uint32 Index)override final;
GLProgramResources &GetProgramResources(SHADER_TYPE ShaderType, PipelineStateGLImpl *pdbgPSO);
diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
index f5d2d038..c73705c1 100644
--- a/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
@@ -203,4 +203,16 @@ IShaderVariable* ShaderGLImpl::GetShaderVariable( const Char* Name )
return pShaderVar;
}
+Uint32 ShaderGLImpl::GetVariableCount() const
+{
+ UNSUPPORTED("Not yet implemented");
+ return 0;
+}
+
+IShaderVariable* ShaderGLImpl::GetShaderVariable(Uint32 Index)
+{
+ UNSUPPORTED("Not yet implemented");
+ return nullptr;
+}
+
}
diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
index 91b19e72..2774295b 100644
--- a/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
@@ -94,6 +94,18 @@ IShaderVariable *ShaderResourceBindingGLImpl::GetVariable(SHADER_TYPE ShaderType
return pVar;
}
+Uint32 ShaderResourceBindingGLImpl::GetVariableCount(SHADER_TYPE ShaderType) const
+{
+ UNSUPPORTED("Not yet implemented");
+ return 0;
+}
+
+IShaderVariable* ShaderResourceBindingGLImpl::GetVariable(SHADER_TYPE ShaderType, Uint32 Index)
+{
+ UNSUPPORTED("Not yet implemented");
+ return 0;
+}
+
static GLProgramResources NullProgramResources;
GLProgramResources &ShaderResourceBindingGLImpl::GetProgramResources(SHADER_TYPE ShaderType, PipelineStateGLImpl *pdbgPSO)
{