diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-04-26 16:05:36 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-04-26 16:05:36 +0000 |
| commit | 6e5be00eb6db740e5db88a49f5a158f74fd7eb47 (patch) | |
| tree | b526d1f7dd966641f1de1ece95fb79c21b0ceb16 /Graphics/GraphicsEngineVulkan | |
| parent | Added SPIRVShaderResources class (diff) | |
| download | DiligentCore-6e5be00eb6db740e5db88a49f5a158f74fd7eb47.tar.gz DiligentCore-6e5be00eb6db740e5db88a49f5a158f74fd7eb47.zip | |
Working on SPIRV resource loading
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h | 18 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 8 |
2 files changed, 13 insertions, 13 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h index a861700f..d2541077 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h @@ -31,6 +31,7 @@ #include "ShaderBase.h" #include "ShaderResourceLayoutVk.h" #include "VulkanUtilities/VulkanObjectWrappers.h" +#include "SPIRVShaderResources.h" #ifdef _DEBUG # define VERIFY_SHADER_BINDINGS @@ -62,10 +63,9 @@ public: return m_VkShaderModule; } -/* - const std::shared_ptr<const ShaderResourcesVk>& GetShaderResources()const{return m_pShaderResources;} - const ShaderResourceLayoutVk& GetConstResLayout()const{return m_StaticResLayout;} - + const std::shared_ptr<const SPIRVShaderResources>& GetShaderResources()const{return m_pShaderResources;} + //const ShaderResourceLayoutVk& GetConstResLayout()const{return m_StaticResLayout;} + /* #ifdef VERIFY_SHADER_BINDINGS void DbgVerifyStaticResourceBindings(); #endif @@ -73,13 +73,13 @@ public: private: DummyShaderVariable m_DummyShaderVar; ///< Dummy shader variable - + */ // ShaderResources class instance must be referenced through the shared pointer, because // it is referenced by ShaderResourceLayoutVk class instances - std::shared_ptr<const ShaderResourcesVk> m_pShaderResources; - ShaderResourceLayoutVk m_StaticResLayout; - ShaderResourceCacheVk m_ConstResCache; -*/ + std::shared_ptr<const SPIRVShaderResources> m_pShaderResources; + //ShaderResourceLayoutVk m_StaticResLayout; + //ShaderResourceCacheVk m_ConstResCache; + VulkanUtilities::ShaderModuleWrapper m_VkShaderModule; }; diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index 507d3aea..73c97870 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -59,13 +59,13 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters *pRefCounters, RenderDeviceVkImpl ShaderModuleCI.pCode = SPIRV.data(); m_VkShaderModule = LogicalDevice.CreateShaderModule(ShaderModuleCI, m_Desc.Name); -/* // Load shader resources auto &Allocator = GetRawAllocator(); - auto *pRawMem = ALLOCATE(Allocator, "Allocator for ShaderResources", sizeof(ShaderResourcesVk)); - auto *pResources = new (pRawMem) ShaderResourcesVk(m_pShaderByteCode, m_Desc); - m_pShaderResources.reset(pResources, STDDeleterRawMem<ShaderResourcesVk>(Allocator)); + auto *pRawMem = ALLOCATE(Allocator, "Allocator for ShaderResources", sizeof(SPIRVShaderResources)); + auto *pResources = new (pRawMem) SPIRVShaderResources(Allocator, m_Desc.ShaderType, std::move(SPIRV)); + m_pShaderResources.reset(pResources, STDDeleterRawMem<SPIRVShaderResources>(Allocator)); + /* // Clone only static resources that will be set directly in the shader // http://diligentgraphics.com/diligent-engine/architecture/Vk/shader-resource-layout#Initializing-Special-Resource-Layout-for-Managing-Static-Shader-Resources SHADER_VARIABLE_TYPE VarTypes[] = {SHADER_VARIABLE_TYPE_STATIC}; |
