summaryrefslogtreecommitdiffstats
path: root/tools/gfx/renderer-shared.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-02-01 20:00:55 -0800
committerGitHub <noreply@github.com>2022-02-01 20:00:55 -0800
commit5deb82929d289d6341e1919ee95b18b10f6db789 (patch)
tree196daa08b9e2805e6c686759a10f186ef57b3763 /tools/gfx/renderer-shared.cpp
parente59516fa8c3a16eb7b99a928c5b85b97bf44fd72 (diff)
GFX: Add API interception mechanism for pipeline creation. (#2115)
This allows the user application to intercept API calls to create pipeline states. This feature can be used to integrate NVAPI in the user application. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/renderer-shared.cpp')
-rw-r--r--tools/gfx/renderer-shared.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp
index 52cf7ffac..7ba939530 100644
--- a/tools/gfx/renderer-shared.cpp
+++ b/tools/gfx/renderer-shared.cpp
@@ -33,6 +33,7 @@ const Slang::Guid GfxGUID::IID_IQueryPool = SLANG_UUID_IQueryPool;
const Slang::Guid GfxGUID::IID_IAccelerationStructure = SLANG_UUID_IAccelerationStructure;
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;
StageType translateStage(SlangStage slangStage)
@@ -296,6 +297,12 @@ IDevice* gfx::RendererBase::getInterface(const Guid& guid)
SLANG_NO_THROW Result SLANG_MCALL RendererBase::initialize(const Desc& desc)
{
+ if (desc.apiCommandDispatcher)
+ {
+ desc.apiCommandDispatcher->queryInterface(
+ GfxGUID::IID_IPipelineCreationAPIDispatcher,
+ (void**)m_pipelineCreationAPIDispatcher.writeRef());
+ }
return SLANG_OK;
}