From 5874e6b071ffbb9cc73f96bb7bf6afff5a532ff9 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 9 Nov 2018 09:01:53 -0800 Subject: Using entry point name from SPIRV bytecode (fixed https://github.com/DiligentGraphics/DiligentCore/issues/39) --- Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h | 2 +- Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h index adcc6a31..d42973c2 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h @@ -96,7 +96,7 @@ private: ShaderResourceCacheVk m_StaticResCache; ShaderVariableManagerVk m_StaticVarsMgr; - const std::string m_EntryPoint; + std::string m_EntryPoint; std::vector m_SPIRV; }; diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index 56e32ed1..54ce0030 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -38,8 +38,7 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* TShaderBase (pRefCounters, pRenderDeviceVk, CreationAttribs.Desc), m_StaticResLayout (*this, pRenderDeviceVk->GetLogicalDevice()), m_StaticResCache (ShaderResourceCacheVk::DbgCacheContentType::StaticShaderResources), - m_StaticVarsMgr (*this), - m_EntryPoint (CreationAttribs.EntryPoint) + m_StaticVarsMgr (*this) { if (CreationAttribs.Source != nullptr || CreationAttribs.FilePath != nullptr) { @@ -80,7 +79,7 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* auto& Allocator = GetRawAllocator(); auto* pRawMem = ALLOCATE(Allocator, "Allocator for ShaderResources", sizeof(SPIRVShaderResources)); bool IsHLSLVertexShader = CreationAttribs.SourceLanguage == SHADER_SOURCE_LANGUAGE_HLSL && m_Desc.ShaderType == SHADER_TYPE_VERTEX; - auto* pResources = new (pRawMem) SPIRVShaderResources(Allocator, pRenderDeviceVk, m_SPIRV, m_Desc, CreationAttribs.UseCombinedTextureSamplers ? CreationAttribs.CombinedSamplerSuffix : nullptr, IsHLSLVertexShader); + auto* pResources = new (pRawMem) SPIRVShaderResources(Allocator, pRenderDeviceVk, m_SPIRV, m_Desc, CreationAttribs.UseCombinedTextureSamplers ? CreationAttribs.CombinedSamplerSuffix : nullptr, IsHLSLVertexShader, m_EntryPoint); m_pShaderResources.reset(pResources, STDDeleterRawMem(Allocator)); if (IsHLSLVertexShader) -- cgit v1.2.3