diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2021-01-26 13:32:03 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-26 13:32:03 -0800 |
| commit | a90c850735664e2928e4cc961442a126c6859b97 (patch) | |
| tree | 8b5e12113319ae87c57f5e616408eb955fe85a2c /tools/gfx/vulkan/render-vk.cpp | |
| parent | 50676c741e10ffe6f710c5de86387eaacd274a9a (diff) | |
Integrate reflection more deeply into gfx layer (#1677)
Diffstat (limited to 'tools/gfx/vulkan/render-vk.cpp')
| -rw-r--r-- | tools/gfx/vulkan/render-vk.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp index 88cd52ad7..5afe3e3b4 100644 --- a/tools/gfx/vulkan/render-vk.cpp +++ b/tools/gfx/vulkan/render-vk.cpp @@ -307,17 +307,9 @@ public: VkDeviceSize size; }; - class ShaderProgramImpl: public IShaderProgram, public RefObject + class ShaderProgramImpl: public GraphicsCommonShaderProgram { public: - SLANG_REF_OBJECT_IUNKNOWN_ALL - IShaderProgram* getInterface(const Guid& guid) - { - if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IShaderProgram) - return static_cast<IShaderProgram*>(this); - return nullptr; - } - public: ShaderProgramImpl(const VulkanApi& api, PipelineType pipelineType): m_api(&api), @@ -2835,6 +2827,11 @@ void VKRenderer::setDescriptorSet(PipelineType pipelineType, IPipelineLayout* la Result VKRenderer::createProgram(const IShaderProgram::Desc& desc, IShaderProgram** outProgram) { + if( desc.kernelCount == 0 ) + { + return createProgramFromSlang(this, desc, outProgram); + } + RefPtr<ShaderProgramImpl> impl = new ShaderProgramImpl(m_api, desc.pipelineType); if( desc.pipelineType == PipelineType::Compute) { @@ -2849,6 +2846,7 @@ Result VKRenderer::createProgram(const IShaderProgram::Desc& desc, IShaderProgra impl->m_vertex = compileEntryPoint(*vertexKernel, VK_SHADER_STAGE_VERTEX_BIT, impl->m_buffers[0], impl->m_modules[0]); impl->m_fragment = compileEntryPoint(*fragmentKernel, VK_SHADER_STAGE_FRAGMENT_BIT, impl->m_buffers[1], impl->m_modules[1]); } + initProgramCommon(impl, desc); *outProgram = impl.detach(); return SLANG_OK; } |
