From 5deb82929d289d6341e1919ee95b18b10f6db789 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 1 Feb 2022 20:00:55 -0800 Subject: 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 --- tools/gfx/renderer-shared.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/gfx/renderer-shared.cpp') 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; } -- cgit v1.2.3