diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-10-29 04:32:18 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-10-29 04:32:18 +0000 |
| commit | e02f4117714a4674306ff12c82f0ad9f1953d95f (patch) | |
| tree | a36464abc2f706af39123baa3de1701820878cb5 /Graphics/GraphicsEngineVulkan | |
| parent | Minor changes to ShaderResourceLayoutVk (diff) | |
| download | DiligentCore-e02f4117714a4674306ff12c82f0ad9f1953d95f.tar.gz DiligentCore-e02f4117714a4674306ff12c82f0ad9f1953d95f.zip | |
Allowed arbitrary entry point name in compiled SPIRV bytecode
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h | 3 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp | 6 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h index f2febb53..144581bf 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h @@ -80,6 +80,8 @@ public: const ShaderResourceLayoutVk& GetStaticResLayout()const{return m_StaticResLayout;} ShaderResourceCacheVk& GetStaticResCache(){return m_StaticResCache;} + const char* GetEntryPoint() const { return m_EntryPoint.c_str(); } + #ifdef DEVELOPMENT void DvpVerifyStaticResourceBindings(); #endif @@ -92,6 +94,7 @@ private: ShaderResourceCacheVk m_StaticResCache; ShaderVariableManagerVk m_StaticVarsMgr; + const std::string m_EntryPoint; std::vector<uint32_t> m_SPIRV; }; diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp index f74f4afb..a5cd7342 100644 --- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp @@ -172,8 +172,8 @@ PipelineStateVkImpl :: PipelineStateVkImpl(IReferenceCounters* pRefCounters std::array<VkPipelineShaderStageCreateInfo, MaxShadersInPipeline> ShaderStages = {}; for (Uint32 s = 0; s < m_NumShaders; ++s) { - auto* pShader = m_ppShaders[s]; - auto ShaderType = pShader->GetDesc().ShaderType; + auto* pShaderVk = GetShader<const ShaderVkImpl>(s); + auto ShaderType = pShaderVk->GetDesc().ShaderType; auto& StageCI = ShaderStages[s]; StageCI.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; @@ -200,7 +200,7 @@ PipelineStateVkImpl :: PipelineStateVkImpl(IReferenceCounters* pRefCounters m_ShaderModules[s] = LogicalDevice.CreateShaderModule(ShaderModuleCI, m_Desc.Name); StageCI.module = m_ShaderModules[s]; - StageCI.pName = "main"; // entry point + StageCI.pName = pShaderVk->GetEntryPoint(); StageCI.pSpecializationInfo = nullptr; } diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index 137727ff..23d2123d 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -37,7 +37,8 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* TShaderBase (pRefCounters, pRenderDeviceVk, CreationAttribs.Desc), m_StaticResLayout (*this, pRenderDeviceVk->GetLogicalDevice()), m_StaticResCache (ShaderResourceCacheVk::DbgCacheContentType::StaticShaderResources), - m_StaticVarsMgr (*this) + m_StaticVarsMgr (*this), + m_EntryPoint (CreationAttribs.EntryPoint) { if (CreationAttribs.Source != nullptr || CreationAttribs.FilePath != nullptr) { |
