From ccce7d6fb134a653d7f9b6fd4089f1ba99777bb7 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 25 Feb 2019 21:16:05 -0800 Subject: Updated SaderVkImpl: removed static resources --- .../GraphicsEngineVulkan/include/ShaderVkImpl.h | 40 ++++++---------------- Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 23 +++---------- 2 files changed, 14 insertions(+), 49 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h index c21e10a2..c646820c 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h @@ -29,9 +29,7 @@ #include "RenderDeviceVk.h" #include "ShaderVk.h" #include "ShaderBase.h" -#include "ShaderResourceLayoutVk.h" #include "SPIRVShaderResources.h" -#include "ShaderVariableVk.h" #include "RenderDeviceVkImpl.h" namespace Diligent @@ -46,55 +44,37 @@ class ShaderVkImpl final : public ShaderBase public: using TShaderBase = ShaderBase; - ShaderVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* pRenderDeviceVk, const ShaderCreationAttribs &CreationAttribs); + ShaderVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* pRenderDeviceVk, const ShaderCreateInfo &CreationAttribs); ~ShaderVkImpl(); - //virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override; + IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_ShaderVk, TShaderBase); - virtual void BindResources( IResourceMapping* pResourceMapping, Uint32 Flags )override + virtual Uint32 GetResourceCount()const { - m_StaticVarsMgr.BindResources(pResourceMapping, Flags); + UNSUPPORTED("Not yet implemented"); + return 0; } - virtual IShaderVariable* GetShaderVariable(const Char* Name)override + virtual const ShaderResourceDesc* GetResources()const { - return m_StaticVarsMgr.GetVariable(Name); - } - - virtual Uint32 GetVariableCount() const override final - { - return m_StaticVarsMgr.GetVariableCount(); - } - - virtual IShaderVariable* GetShaderVariable(Uint32 Index)override final - { - return m_StaticVarsMgr.GetVariable(Index); + UNSUPPORTED("Not yet implemented"); + return nullptr; } virtual const std::vector& GetSPIRV()const override final { return m_SPIRV; } - + const std::shared_ptr& GetShaderResources()const{return m_pShaderResources;} - const ShaderResourceLayoutVk& GetStaticResLayout()const { return m_StaticResLayout; } - const ShaderResourceCacheVk& GetStaticResCache() const { return m_StaticResCache; } - const char* GetEntryPoint() const { return m_EntryPoint.c_str(); } -#ifdef DEVELOPMENT - bool DvpVerifyStaticResourceBindings()const; -#endif - private: void MapHLSLVertexShaderInputs(); - // ShaderResources class instance must be referenced through the shared pointer, because + // SPIRVShaderResources class instance must be referenced through the shared pointer, because // it is referenced by ShaderResourceLayoutVk class instances std::shared_ptr m_pShaderResources; - ShaderResourceLayoutVk m_StaticResLayout; - ShaderResourceCacheVk m_StaticResCache; - ShaderVariableManagerVk m_StaticVarsMgr; std::string m_EntryPoint; std::vector m_SPIRV; diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index fef2d052..3cf4c3f0 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -37,13 +37,10 @@ namespace Diligent { -ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, - RenderDeviceVkImpl* pRenderDeviceVk, - const ShaderCreationAttribs& CreationAttribs) : - TShaderBase (pRefCounters, pRenderDeviceVk, CreationAttribs.Desc), - m_StaticResLayout (*this, pRenderDeviceVk->GetLogicalDevice()), - m_StaticResCache (ShaderResourceCacheVk::DbgCacheContentType::StaticShaderResources), - m_StaticVarsMgr (*this) +ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, + RenderDeviceVkImpl* pRenderDeviceVk, + const ShaderCreateInfo& CreationAttribs) : + TShaderBase(pRefCounters, pRenderDeviceVk, CreationAttribs.Desc) { if (CreationAttribs.Source != nullptr || CreationAttribs.FilePath != nullptr) { @@ -95,10 +92,6 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, { MapHLSLVertexShaderInputs(); } - - m_StaticResLayout.InitializeStaticResourceLayout(m_pShaderResources, GetRawAllocator(), m_StaticResCache); - // m_StaticResLayout only contains static resources, so reference all of them - m_StaticVarsMgr.Initialize(m_StaticResLayout, GetRawAllocator(), nullptr, 0, m_StaticResCache); } void ShaderVkImpl::MapHLSLVertexShaderInputs() @@ -134,14 +127,6 @@ void ShaderVkImpl::MapHLSLVertexShaderInputs() ShaderVkImpl::~ShaderVkImpl() { - m_StaticVarsMgr.Destroy(GetRawAllocator()); } -#ifdef DEVELOPMENT -bool ShaderVkImpl::DvpVerifyStaticResourceBindings()const -{ - return m_StaticResLayout.dvpVerifyBindings(m_StaticResCache); -} -#endif - } -- cgit v1.2.3