diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2024-02-06 19:31:28 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-06 17:31:28 -0800 |
| commit | 3358b3dd4680cc3f86bbd22b84c242c7f0053775 (patch) | |
| tree | ebf47d55ea30e7562f91af5662ae166c78a11541 /tools/gfx/renderer-shared.cpp | |
| parent | f359df9202140ee575d0c2efd3bb10880edcc331 (diff) | |
gfx:Add callback to IPipelineCreationAPIDispatcher (#3556)
* gfx:Add callback to IPipelineCreationAPIDispatcher
Add the callback to IPipelineCreationAPIDispatcher in Vulkan backend
in slang-gfx lib.
* gfx:add uuid for vulkan pipeline dispatcher
Add a define of SLANG_UUID_IVulkanPipelineCreationAPIDispatcher
for Vulkan specific IPipelineCreationAPIDispatcher such that
libgfx.so can have special handle to Vulkan pipeline dispatcher without
break binary compatibility.
In the RendererBase::initialize call, we will provide this new UUID when
the DeviceType is Vulkan.
* gfx: add new variable to GfxGUID
Add new variable to GfxGUID IID_IVulkanPipelineCreationAPIDispatcher
with initialization of SLANG_UUID_IVulkanPipelineCreationAPIDispatcher
to make the implementation aligned with existing
GfxGUID::IID_IPipelineCreationAPIDispatcher.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tools/gfx/renderer-shared.cpp')
| -rw-r--r-- | tools/gfx/renderer-shared.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp index 5111edee5..54311dd47 100644 --- a/tools/gfx/renderer-shared.cpp +++ b/tools/gfx/renderer-shared.cpp @@ -46,6 +46,7 @@ const Slang::Guid GfxGUID::IID_IAccelerationStructure = SLANG_UUID_IAcceleration const Slang::Guid GfxGUID::IID_IFence = SLANG_UUID_IFence; const Slang::Guid GfxGUID::IID_IShaderTable = SLANG_UUID_IShaderTable; const Slang::Guid GfxGUID::IID_IPipelineCreationAPIDispatcher = SLANG_UUID_IPipelineCreationAPIDispatcher; +const Slang::Guid GfxGUID::IID_IVulkanPipelineCreationAPIDispatcher = SLANG_UUID_IVulkanPipelineCreationAPIDispatcher; const Slang::Guid GfxGUID::IID_ITransientResourceHeapD3D12 = SLANG_UUID_ITransientResourceHeapD3D12; @@ -397,9 +398,18 @@ SLANG_NO_THROW Result SLANG_MCALL RendererBase::initialize(const Desc& desc) if (desc.apiCommandDispatcher) { - desc.apiCommandDispatcher->queryInterface( - GfxGUID::IID_IPipelineCreationAPIDispatcher, - (void**)m_pipelineCreationAPIDispatcher.writeRef()); + if (desc.deviceType == DeviceType::Vulkan) + { + desc.apiCommandDispatcher->queryInterface( + GfxGUID::IID_IVulkanPipelineCreationAPIDispatcher, + (void**)m_pipelineCreationAPIDispatcher.writeRef()); + } + else + { + desc.apiCommandDispatcher->queryInterface( + GfxGUID::IID_IPipelineCreationAPIDispatcher, + (void**)m_pipelineCreationAPIDispatcher.writeRef()); + } } return SLANG_OK; } |
