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/GraphicsEngineVulkan/include/ShaderVkImpl.h | 2 +- Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h index 6da22a8b..1fa1053c 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h @@ -60,7 +60,7 @@ public: } /// Implementation of IShader::GetResource() in Vulkan backend. - virtual ShaderResourceDesc GetResource(Uint32 Index) const override final; + virtual void GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDesc) const override final; /// Implementation of IShaderVk::GetSPIRV(). virtual const std::vector& GetSPIRV() const override final diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index ef570dc0..e024643a 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -145,17 +145,15 @@ ShaderVkImpl::~ShaderVkImpl() { } -ShaderResourceDesc ShaderVkImpl::GetResource(Uint32 Index) const +void ShaderVkImpl::GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDesc) const { auto ResCount = GetResourceCount(); DEV_CHECK_ERR(Index < ResCount, "Resource index (", Index, ") is out of range"); - ShaderResourceDesc ResourceDesc; if (Index < ResCount) { const auto& SPIRVResource = m_pShaderResources->GetResource(Index); ResourceDesc = SPIRVResource.GetResourceDesc(); } - return ResourceDesc; } } // namespace Diligent -- cgit v1.2.3