From 6866e442b789df5c15693c2d38ae6abc740c5bd2 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 25 Jan 2020 22:31:42 -0800 Subject: Reworked IShader::GetResource to be compatible with C; renamed the method to GetResourceDesc --- Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h | 2 +- Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h index 760c3c04..a2528381 100644 --- a/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h @@ -90,7 +90,7 @@ public: virtual Uint32 GetResourceCount() const override final; /// Implementation of IShader::GetResource() in OpenGL backend. - virtual ShaderResourceDesc GetResource(Uint32 Index) const override final; + virtual void GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDesc) const override final; static GLObjectWrappers::GLProgramObj LinkProgram(IShader** ppShaders, Uint32 NumShaders, bool IsSeparableProgram); diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp index 0479e80f..8a38bf01 100644 --- a/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp @@ -221,9 +221,8 @@ Uint32 ShaderGLImpl::GetResourceCount() const } } -ShaderResourceDesc ShaderGLImpl::GetResource(Uint32 Index) const +void ShaderGLImpl::GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDesc) const { - ShaderResourceDesc ResourceDesc; if (m_pDevice->GetDeviceCaps().Features.SeparablePrograms) { DEV_CHECK_ERR(Index < GetResourceCount(), "Index is out of range"); @@ -233,7 +232,6 @@ ShaderResourceDesc ShaderGLImpl::GetResource(Uint32 Index) const { LOG_WARNING_MESSAGE("Shader resource queries are not available when separate shader objects are unsupported"); } - return ResourceDesc; } } // namespace Diligent -- cgit v1.2.3