summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-02-26 05:16:05 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-02-26 05:16:05 +0000
commitccce7d6fb134a653d7f9b6fd4089f1ba99777bb7 (patch)
treeeb66a94612cebd756c10f668818bad539a3d84df /Graphics/GraphicsEngineVulkan
parentUpdated SPIRVShaderResources: removed immutable samplers and variable type (diff)
downloadDiligentCore-ccce7d6fb134a653d7f9b6fd4089f1ba99777bb7.tar.gz
DiligentCore-ccce7d6fb134a653d7f9b6fd4089f1ba99777bb7.zip
Updated SaderVkImpl: removed static resources
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h40
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp23
2 files changed, 14 insertions, 49 deletions
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<IShaderVk, RenderDeviceVkImpl>
public:
using TShaderBase = ShaderBase<IShaderVk, RenderDeviceVkImpl>;
- 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<uint32_t>& GetSPIRV()const override final
{
return m_SPIRV;
}
-
+
const std::shared_ptr<const SPIRVShaderResources>& 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<const SPIRVShaderResources> m_pShaderResources;
- ShaderResourceLayoutVk m_StaticResLayout;
- ShaderResourceCacheVk m_StaticResCache;
- ShaderVariableManagerVk m_StaticVarsMgr;
std::string m_EntryPoint;
std::vector<uint32_t> 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
-
}