From be74a747d51000cfb1b82ae0567c067b083969cc Mon Sep 17 00:00:00 2001 From: MikhailGorobets Date: Sat, 3 Oct 2026 19:41:11 +0600 Subject: [PATCH] SuperResolution: Add archived FSR pipeline state support --- .../interface/SuperResolutionFactory.h | 39 +++++++++- .../interface/SuperResolutionFactoryLoader.h | 18 +++-- Graphics/SuperResolution/readme.md | 23 +++++- Graphics/SuperResolution/src/FSRProvider.cpp | 74 +++++++++++++++++-- .../src/SuperResolutionFactory.cpp | 37 +++++----- .../src/SuperResolutionTest.cpp | 6 +- .../SuperResolutionFactoryH_test.c | 15 ++++ .../SuperResolutionFactoryH_test.cpp | 15 ++++ 8 files changed, 189 insertions(+), 38 deletions(-) diff --git a/Graphics/SuperResolution/interface/SuperResolutionFactory.h b/Graphics/SuperResolution/interface/SuperResolutionFactory.h index 62ca1d49e6..b73bfc698f 100644 --- a/Graphics/SuperResolution/interface/SuperResolutionFactory.h +++ b/Graphics/SuperResolution/interface/SuperResolutionFactory.h @@ -33,6 +33,7 @@ #include "../../../Primitives/interface/DebugOutput.h" #include "../../../Primitives/interface/MemoryAllocator.h" #include "../../../Primitives/interface/FlagEnum.h" +#include "../../../Graphics/GraphicsEngine/interface/Dearchiver.h" #include "../../../Graphics/GraphicsEngine/interface/RenderDevice.h" #include "SuperResolution.h" @@ -45,6 +46,31 @@ static DILIGENT_CONSTEXPR INTERFACE_ID IID_SuperResolutionFactory = // clang-format off +/// FSR implementation creation attributes. +struct SuperResolutionFSRCreateInfo +{ + /// Dearchiver that contains the FSR pipeline states. + IDearchiver* pDearchiver DEFAULT_INITIALIZER(nullptr); + + /// Name of the edge-adaptive upsampling pipeline state in the archive. + const Char* EASUPSOName DEFAULT_INITIALIZER(nullptr); + + /// Name of the contrast-adaptive sharpening pipeline state in the archive. + const Char* RCASPSOName DEFAULT_INITIALIZER(nullptr); +}; +typedef struct SuperResolutionFSRCreateInfo SuperResolutionFSRCreateInfo; + +/// Super resolution factory creation attributes. +struct SuperResolutionFactoryCreateInfo +{ + /// Render device used by the super resolution implementations. + IRenderDevice* pDevice DEFAULT_INITIALIZER(nullptr); + + /// Optional FSR implementation creation attributes. + const SuperResolutionFSRCreateInfo* pFSRCreateInfo DEFAULT_INITIALIZER(nullptr); +}; +typedef struct SuperResolutionFactoryCreateInfo SuperResolutionFactoryCreateInfo; + /// Super resolution upscaler type. DILIGENT_TYPED_ENUM(SUPER_RESOLUTION_TYPE, Uint8) { @@ -328,12 +354,17 @@ DILIGENT_END_INTERFACE #endif -/// Creates a super resolution factory for the specified render device. +#include "../../../Primitives/interface/DefineGlobalFuncHelperMacros.h" -/// \param [in] pDevice - Render device to create the factory for. +/// Creates a super resolution factory using the specified creation attributes. + +/// \param [in] CreateInfo - Factory creation attributes, see +/// Diligent::SuperResolutionFactoryCreateInfo. /// \param [out] ppFactory - Address of the memory location where a pointer to the /// super resolution factory interface will be written. -void DILIGENT_GLOBAL_FUNCTION(CreateSuperResolutionFactory)(IRenderDevice* pDevice, - ISuperResolutionFactory** ppFactory); +void DILIGENT_GLOBAL_FUNCTION(CreateSuperResolutionFactory)(const SuperResolutionFactoryCreateInfo REF CreateInfo, + ISuperResolutionFactory** ppFactory); + +#include "../../../Primitives/interface/UndefGlobalFuncHelperMacros.h" DILIGENT_END_NAMESPACE // namespace Diligent diff --git a/Graphics/SuperResolution/interface/SuperResolutionFactoryLoader.h b/Graphics/SuperResolution/interface/SuperResolutionFactoryLoader.h index c01f1ae1d2..ad59ee1803 100644 --- a/Graphics/SuperResolution/interface/SuperResolutionFactoryLoader.h +++ b/Graphics/SuperResolution/interface/SuperResolutionFactoryLoader.h @@ -44,7 +44,9 @@ DILIGENT_BEGIN_NAMESPACE(Diligent) -typedef void (*CreateSuperResolutionFactoryType)(IRenderDevice* pDevice, ISuperResolutionFactory** ppFactory); +#include "../../../Primitives/interface/DefineGlobalFuncHelperMacros.h" + +typedef void (*CreateSuperResolutionFactoryType)(const SuperResolutionFactoryCreateInfo REF CreateInfo, ISuperResolutionFactory** ppFactory); #if DILIGENT_SUPER_RESOLUTION_EXPLICIT_LOAD @@ -61,15 +63,15 @@ inline CreateSuperResolutionFactoryType DILIGENT_GLOBAL_FUNCTION(LoadSuperResolu #else API_QUALIFIER -void DILIGENT_GLOBAL_FUNCTION(CreateSuperResolutionFactory)(IRenderDevice* pDevice, - ISuperResolutionFactory** ppFactory); +void DILIGENT_GLOBAL_FUNCTION(CreateSuperResolutionFactory)(const SuperResolutionFactoryCreateInfo REF CreateInfo, + ISuperResolutionFactory** ppFactory); #endif /// Loads the SuperResolution implementation DLL if necessary and creates a SuperResolution factory -/// for the specified render device. -inline void DILIGENT_GLOBAL_FUNCTION(LoadAndCreateSuperResolutionFactory)(IRenderDevice* pDevice, - ISuperResolutionFactory** ppFactory) +/// using the specified creation attributes. +inline void DILIGENT_GLOBAL_FUNCTION(LoadAndCreateSuperResolutionFactory)(const SuperResolutionFactoryCreateInfo REF CreateInfo, + ISuperResolutionFactory** ppFactory) { CreateSuperResolutionFactoryType CreateFactoryFunc = NULL; #if DILIGENT_SUPER_RESOLUTION_EXPLICIT_LOAD @@ -82,7 +84,9 @@ inline void DILIGENT_GLOBAL_FUNCTION(LoadAndCreateSuperResolutionFactory)(IRende #else CreateFactoryFunc = DILIGENT_GLOBAL_FUNCTION(CreateSuperResolutionFactory); #endif - CreateFactoryFunc(pDevice, ppFactory); + CreateFactoryFunc(CreateInfo, ppFactory); } +#include "../../../Primitives/interface/UndefGlobalFuncHelperMacros.h" + DILIGENT_END_NAMESPACE // namespace Diligent diff --git a/Graphics/SuperResolution/readme.md b/Graphics/SuperResolution/readme.md index c352b93886..b5519d6c6a 100644 --- a/Graphics/SuperResolution/readme.md +++ b/Graphics/SuperResolution/readme.md @@ -125,9 +125,30 @@ The factory is created per render device. On Windows, the module can be loaded a #include "SuperResolutionFactoryLoader.h" RefCntAutoPtr pSRFactory; -LoadAndCreateSuperResolutionFactory(pDevice, &pSRFactory); +SuperResolutionFactoryCreateInfo FactoryCreateInfo; +FactoryCreateInfo.pDevice = pDevice; +LoadAndCreateSuperResolutionFactory(FactoryCreateInfo, &pSRFactory); ``` +`SuperResolutionFSRCreateInfo` can provide archived pipeline states for FSR, avoiding runtime shader compilation: + +```cpp +SuperResolutionFSRCreateInfo FSRCreateInfo; +FSRCreateInfo.pDearchiver = pDearchiver; +FSRCreateInfo.EASUPSOName = "FSR::EASU PSO"; +FSRCreateInfo.RCASPSOName = "FSR::RCAS PSO"; + +SuperResolutionFactoryCreateInfo FactoryCI; +FactoryCI.pDevice = pDevice; +FactoryCI.pFSRCreateInfo = &FSRCreateInfo; + +RefCntAutoPtr pSRFactory; +LoadAndCreateSuperResolutionFactory(FactoryCI, &pSRFactory); +``` + +When the optional FSR attributes are omitted, FSR compiles the shaders and creates the pipeline states at runtime. +When they are provided, the dearchiver must contain both named graphics pipeline states. FSR unpacks and caches a separate pair for every requested output format, overriding the first render target format during unpacking. + ### Enumerating Available Variants Query the list of upscaler variants supported by the current device: diff --git a/Graphics/SuperResolution/src/FSRProvider.cpp b/Graphics/SuperResolution/src/FSRProvider.cpp index c74949efdc..95875a1264 100644 --- a/Graphics/SuperResolution/src/FSRProvider.cpp +++ b/Graphics/SuperResolution/src/FSRProvider.cpp @@ -35,6 +35,7 @@ #include "CommonlyUsedStates.h" #include "ShaderMacroHelper.hpp" #include "BasicMath.hpp" +#include "Dearchiver.h" #include "EngineMemory.h" namespace Diligent @@ -110,6 +111,10 @@ SuperResolutionFSR::SuperResolutionFSR(IReferenceCounters* pRefCounters, m_pEASU_PSO{pEASU_PSO}, m_pRCAS_PSO{pRCAS_PSO} { + VERIFY_SUPER_RESOLUTION(m_Desc.Name, pDevice != nullptr, "Render device must not be null"); + VERIFY_SUPER_RESOLUTION(m_Desc.Name, m_pEASU_PSO != nullptr, "FSR EASU pipeline state must not be null"); + VERIFY_SUPER_RESOLUTION(m_Desc.Name, m_pRCAS_PSO != nullptr, "FSR RCAS pipeline state must not be null"); + { const float InputWidth = static_cast(Desc.InputWidth); const float InputHeight = static_cast(Desc.InputHeight); @@ -199,7 +204,7 @@ void SuperResolutionFSR::Execute(const ExecuteSuperResolutionAttribs& Attribs) class FSRProvider final : public SuperResolutionProvider { public: - FSRProvider(IRenderDevice* pDevice); + FSRProvider(IRenderDevice* pDevice, const SuperResolutionFSRCreateInfo* pCreateInfo); virtual void EnumerateVariants(std::vector& Variants) override final { @@ -213,6 +218,8 @@ class FSRProvider final : public SuperResolutionProvider virtual void CreateSuperResolution(const SuperResolutionDesc& Desc, const SuperResolutionInfo& Info, ISuperResolution** ppUpscaler) override final { + DEV_CHECK_ERR(ppUpscaler != nullptr, "ppUpscaler must not be null"); + auto& Pipelines = GetOrCreatePipelines(Desc.OutputFormat); auto* pUpscaler = NEW_RC_OBJ(GetRawAllocator(), "SuperResolutionFSR instance", SuperResolutionFSR)(m_pDevice, Desc, Info, Pipelines.pEASU_PSO, Pipelines.pRCAS_PSO); pUpscaler->QueryInterface(IID_SuperResolution, reinterpret_cast(ppUpscaler)); @@ -225,6 +232,19 @@ class FSRProvider final : public SuperResolutionProvider RefCntAutoPtr pRCAS_PSO; }; + struct ArchivedPipelineInfo + { + explicit ArchivedPipelineInfo(const SuperResolutionFSRCreateInfo& CI) : + pDearchiver{CI.pDearchiver}, + EASUPSOName{CI.EASUPSOName}, + RCASPSOName{CI.RCASPSOName} + {} + + RefCntAutoPtr pDearchiver; + std::string EASUPSOName; + std::string RCASPSOName; + }; + PipelineData& GetOrCreatePipelines(TEXTURE_FORMAT OutputFormat); RefCntAutoPtr m_pDevice; @@ -232,18 +252,35 @@ class FSRProvider final : public SuperResolutionProvider RefCntAutoPtr m_pVS; RefCntAutoPtr m_pEASU_PS; RefCntAutoPtr m_pRCAS_PS; + std::unique_ptr m_pArchivedPipelineInfo; std::unordered_map> m_PipelineCache; }; -FSRProvider::FSRProvider(IRenderDevice* pDevice) : +FSRProvider::FSRProvider(IRenderDevice* pDevice, const SuperResolutionFSRCreateInfo* pCreateInfo) : m_pDevice{pDevice} { + if (pDevice == nullptr) + LOG_ERROR_AND_THROW("Device must not be null"); + + if (pCreateInfo != nullptr) + { + if (pCreateInfo->pDearchiver == nullptr) + LOG_ERROR_AND_THROW("FSR dearchiver must not be null"); + if (pCreateInfo->EASUPSOName == nullptr || pCreateInfo->EASUPSOName[0] == '\0') + LOG_ERROR_AND_THROW("FSR EASU pipeline state name must not be null or empty"); + if (pCreateInfo->RCASPSOName == nullptr || pCreateInfo->RCASPSOName[0] == '\0') + LOG_ERROR_AND_THROW("FSR RCAS pipeline state name must not be null or empty"); + + m_pArchivedPipelineInfo = std::make_unique(*pCreateInfo); + return; + } + MemoryShaderSourceFactoryCreateInfo CI{HLSL::g_Shaders, _countof(HLSL::g_Shaders)}; CreateMemoryShaderSourceFactory(CI, &m_pShaderSourceFactory); ShaderMacroHelper Macros; - if (pDevice->GetDeviceInfo().Type != RENDER_DEVICE_TYPE_GLES) + if (m_pDevice->GetDeviceInfo().Type != RENDER_DEVICE_TYPE_GLES) Macros.AddShaderMacro("FSR_FEATURE_TEXTURE_GATHER", 1); auto CreateShader = [&](SHADER_TYPE Type, const char* Name, const char* EntryPoint, const char* FilePath, const ShaderMacroArray& ShaderMacros = {}) { @@ -257,13 +294,16 @@ FSRProvider::FSRProvider(IRenderDevice* pDevice) : ShaderCI.Macros = ShaderMacros; ShaderCI.pShaderSourceStreamFactory = m_pShaderSourceFactory; RefCntAutoPtr pShader; - pDevice->CreateShader(ShaderCI, &pShader); + m_pDevice->CreateShader(ShaderCI, &pShader); return pShader; }; m_pVS = CreateShader(SHADER_TYPE_VERTEX, "FSR FullQuad VS", "FSR_FullQuadVS", "FSR_FullQuad.fx"); m_pEASU_PS = CreateShader(SHADER_TYPE_PIXEL, "FSR EASU PS", "ComputeEdgeAdaptiveUpsamplingPS", "FSR_EdgeAdaptiveUpsampling.fx", Macros); m_pRCAS_PS = CreateShader(SHADER_TYPE_PIXEL, "FSR RCAS PS", "ComputeContrastAdaptiveSharpeningPS", "FSR_ContrastAdaptiveSharpening.fx"); + + if (!m_pVS || !m_pEASU_PS || !m_pRCAS_PS) + LOG_ERROR_AND_THROW("Failed to create FSR shaders"); } FSRProvider::PipelineData& FSRProvider::GetOrCreatePipelines(TEXTURE_FORMAT OutputFormat) @@ -274,6 +314,28 @@ FSRProvider::PipelineData& FSRProvider::GetOrCreatePipelines(TEXTURE_FORMAT Outp PipelineData& Data = m_PipelineCache[OutputFormat]; + if (m_pArchivedPipelineInfo) + { + auto ModifyPipelineStateCreateInfo = [](PipelineStateCreateInfo& PipelineCI, void* pUserData) { + auto& GraphicsPipelineCI = static_cast(PipelineCI); + GraphicsPipelineCI.GraphicsPipeline.RTVFormats[0] = *static_cast(pUserData); + }; + + PipelineStateUnpackInfo UnpackInfo; + UnpackInfo.pDevice = m_pDevice; + UnpackInfo.PipelineType = PIPELINE_TYPE_GRAPHICS; + UnpackInfo.ModifyPipelineStateCreateInfo = ModifyPipelineStateCreateInfo; + UnpackInfo.pUserData = &OutputFormat; + + UnpackInfo.Name = m_pArchivedPipelineInfo->EASUPSOName.c_str(); + m_pArchivedPipelineInfo->pDearchiver->UnpackPipelineState(UnpackInfo, &Data.pEASU_PSO); + + UnpackInfo.Name = m_pArchivedPipelineInfo->RCASPSOName.c_str(); + m_pArchivedPipelineInfo->pDearchiver->UnpackPipelineState(UnpackInfo, &Data.pRCAS_PSO); + + return Data; + } + { PipelineResourceLayoutDescX ResourceLayout; ResourceLayout @@ -318,9 +380,9 @@ FSRProvider::PipelineData& FSRProvider::GetOrCreatePipelines(TEXTURE_FORMAT Outp } // anonymous namespace -std::unique_ptr CreateFSRProvider(IRenderDevice* pDevice) +std::unique_ptr CreateFSRProvider(IRenderDevice* pDevice, const SuperResolutionFSRCreateInfo* pCreateInfo) { - return std::make_unique(pDevice); + return std::make_unique(pDevice, pCreateInfo); } } // namespace Diligent diff --git a/Graphics/SuperResolution/src/SuperResolutionFactory.cpp b/Graphics/SuperResolution/src/SuperResolutionFactory.cpp index c20b0d3e4d..5e529590a4 100644 --- a/Graphics/SuperResolution/src/SuperResolutionFactory.cpp +++ b/Graphics/SuperResolution/src/SuperResolutionFactory.cpp @@ -57,7 +57,7 @@ std::unique_ptr CreateMetalFXProvider(IRenderDevice* pD #endif #if DILIGENT_FSR_SUPPORTED -std::unique_ptr CreateFSRProvider(IRenderDevice* pDevice); +std::unique_ptr CreateFSRProvider(IRenderDevice* pDevice, const SuperResolutionFSRCreateInfo* pCreateInfo); #endif namespace @@ -68,16 +68,14 @@ class SuperResolutionFactory : public ObjectBase public: using TBase = ObjectBase; - SuperResolutionFactory(IReferenceCounters* pRefCounters, IRenderDevice* pDevice) : + SuperResolutionFactory(IReferenceCounters* pRefCounters, const SuperResolutionFactoryCreateInfo& CI) : TBase{pRefCounters} { - auto AddProvider = [this](IRenderDevice* pDevice, - std::unique_ptr CreateProvider(IRenderDevice*), - const char* ProviderName) { + auto AddProvider = [this](auto&& CreateProvider, const char* ProviderName) { try { ProviderInfo ProvInfo; - ProvInfo.Provider = CreateProvider(pDevice); + ProvInfo.Provider = CreateProvider(); if (ProvInfo.Provider) { ProvInfo.Provider->EnumerateVariants(ProvInfo.Variants); @@ -95,22 +93,22 @@ class SuperResolutionFactory : public ObjectBase }; #ifdef DILIGENT_DLSS_D3D11_SUPPORTED - AddProvider(pDevice, CreateDLSSProviderD3D11, "DLSS D3D11"); + AddProvider([&]() { return CreateDLSSProviderD3D11(CI.pDevice); }, "DLSS D3D11"); #endif #ifdef DILIGENT_DLSS_D3D12_SUPPORTED - AddProvider(pDevice, CreateDLSSProviderD3D12, "DLSS D3D12"); + AddProvider([&]() { return CreateDLSSProviderD3D12(CI.pDevice); }, "DLSS D3D12"); #endif #ifdef DILIGENT_DLSS_VK_SUPPORTED - AddProvider(pDevice, CreateDLSSProviderVk, "DLSS Vulkan"); + AddProvider([&]() { return CreateDLSSProviderVk(CI.pDevice); }, "DLSS Vulkan"); #endif #ifdef DILIGENT_DSR_D3D12_SUPPORTED - AddProvider(pDevice, CreateDSRProviderD3D12, "DirectSR D3D12"); + AddProvider([&]() { return CreateDSRProviderD3D12(CI.pDevice); }, "DirectSR D3D12"); #endif #ifdef DILIGENT_METALFX_SUPPORTED - AddProvider(pDevice, CreateMetalFXProvider, "MetalFX"); + AddProvider([&]() { return CreateMetalFXProvider(CI.pDevice); }, "MetalFX"); #endif #ifdef DILIGENT_FSR_SUPPORTED - AddProvider(pDevice, CreateFSRProvider, "FSR Spatial"); + AddProvider([&]() { return CreateFSRProvider(CI.pDevice, CI.pFSRCreateInfo); }, "FSR Spatial"); #endif (void)AddProvider; } @@ -219,7 +217,8 @@ class SuperResolutionFactory : public ObjectBase } // namespace -API_QUALIFIER void CreateSuperResolutionFactory(IRenderDevice* pDevice, ISuperResolutionFactory** ppFactory) +API_QUALIFIER void CreateSuperResolutionFactory(const SuperResolutionFactoryCreateInfo& CreateInfo, + ISuperResolutionFactory** ppFactory) { DEV_CHECK_ERR(ppFactory != nullptr, "ppFactory must not be null"); if (ppFactory == nullptr) @@ -227,13 +226,13 @@ API_QUALIFIER void CreateSuperResolutionFactory(IRenderDevice* pDevice, ISuperRe *ppFactory = nullptr; - DEV_CHECK_ERR(pDevice != nullptr, "pDevice must not be null"); - if (pDevice == nullptr) + DEV_CHECK_ERR(CreateInfo.pDevice != nullptr, "CreateInfo.pDevice must not be null"); + if (CreateInfo.pDevice == nullptr) return; try { - SuperResolutionFactory* pFactory = NEW_RC_OBJ(GetRawAllocator(), "SuperResolutionFactory instance", SuperResolutionFactory)(pDevice); + SuperResolutionFactory* pFactory = NEW_RC_OBJ(GetRawAllocator(), "SuperResolutionFactory instance", SuperResolutionFactory)(CreateInfo); pFactory->QueryInterface(IID_SuperResolutionFactory, reinterpret_cast(ppFactory)); } catch (...) @@ -247,9 +246,9 @@ API_QUALIFIER void CreateSuperResolutionFactory(IRenderDevice* pDevice, ISuperRe extern "C" { API_QUALIFIER - void Diligent_CreateSuperResolutionFactory(Diligent::IRenderDevice* pDevice, - Diligent::ISuperResolutionFactory** ppFactory) + void Diligent_CreateSuperResolutionFactory(const Diligent::SuperResolutionFactoryCreateInfo& CreateInfo, + Diligent::ISuperResolutionFactory** ppFactory) { - Diligent::CreateSuperResolutionFactory(pDevice, ppFactory); + Diligent::CreateSuperResolutionFactory(CreateInfo, ppFactory); } } diff --git a/Tests/DiligentCoreAPITest/src/SuperResolutionTest.cpp b/Tests/DiligentCoreAPITest/src/SuperResolutionTest.cpp index 52dfe2870d..c61e3bc0fe 100644 --- a/Tests/DiligentCoreAPITest/src/SuperResolutionTest.cpp +++ b/Tests/DiligentCoreAPITest/src/SuperResolutionTest.cpp @@ -48,7 +48,11 @@ static ISuperResolutionFactory* GetFactory() auto* pDevice = GPUTestingEnvironment::GetInstance()->GetDevice(); static RefCntAutoPtr pFactory; if (!pFactory) - LoadAndCreateSuperResolutionFactory(pDevice, &pFactory); + { + SuperResolutionFactoryCreateInfo CreateInfo; + CreateInfo.pDevice = pDevice; + LoadAndCreateSuperResolutionFactory(CreateInfo, &pFactory); + } return pFactory; } diff --git a/Tests/IncludeTest/SuperResolution/SuperResolutionFactoryH_test.c b/Tests/IncludeTest/SuperResolution/SuperResolutionFactoryH_test.c index 27b6a6a7d2..1eabc119cb 100644 --- a/Tests/IncludeTest/SuperResolution/SuperResolutionFactoryH_test.c +++ b/Tests/IncludeTest/SuperResolution/SuperResolutionFactoryH_test.c @@ -25,9 +25,24 @@ */ #include "DiligentCore/Graphics/SuperResolution/interface/SuperResolutionFactory.h" +#include "DiligentCore/Graphics/SuperResolution/interface/SuperResolutionFactoryLoader.h" void TestSuperResolutionFactory_CInterface(ISuperResolutionFactory* pSuperResolutionFactory) { + SuperResolutionFSRCreateInfo FSRCreateInfo = {0}; + FSRCreateInfo.pDearchiver = NULL; + FSRCreateInfo.EASUPSOName = NULL; + FSRCreateInfo.RCASPSOName = NULL; + + SuperResolutionFactoryCreateInfo CreateInfo = {0}; + CreateInfo.pDevice = NULL; + CreateInfo.pFSRCreateInfo = &FSRCreateInfo; + Diligent_CreateSuperResolutionFactory(&CreateInfo, (ISuperResolutionFactory**)NULL); + + CreateSuperResolutionFactoryType CreateFactoryFunc = Diligent_CreateSuperResolutionFactory; + CreateFactoryFunc(&CreateInfo, (ISuperResolutionFactory**)NULL); + Diligent_LoadAndCreateSuperResolutionFactory(&CreateInfo, (ISuperResolutionFactory**)NULL); + ISuperResolutionFactory_EnumerateVariants(pSuperResolutionFactory, (Uint32*)NULL, (SuperResolutionInfo*)NULL); ISuperResolutionFactory_GetSourceSettings(pSuperResolutionFactory, (const SuperResolutionSourceSettingsAttribs*)NULL, (SuperResolutionSourceSettings*)NULL); ISuperResolutionFactory_CreateSuperResolution(pSuperResolutionFactory, (const SuperResolutionDesc*)NULL, (ISuperResolution**)NULL); diff --git a/Tests/IncludeTest/SuperResolution/SuperResolutionFactoryH_test.cpp b/Tests/IncludeTest/SuperResolution/SuperResolutionFactoryH_test.cpp index 473932d2c1..3867518d73 100644 --- a/Tests/IncludeTest/SuperResolution/SuperResolutionFactoryH_test.cpp +++ b/Tests/IncludeTest/SuperResolution/SuperResolutionFactoryH_test.cpp @@ -25,3 +25,18 @@ */ #include "DiligentCore/Graphics/SuperResolution/interface/SuperResolutionFactory.h" +#include "DiligentCore/Graphics/SuperResolution/interface/SuperResolutionFactoryLoader.h" + +namespace Diligent +{ + +void TestSuperResolutionFactory_CPPInterface(const SuperResolutionFactoryCreateInfo& CreateInfo, ISuperResolutionFactory** ppFactory) +{ + CreateSuperResolutionFactory(CreateInfo, ppFactory); + + CreateSuperResolutionFactoryType CreateFactoryFunc = CreateSuperResolutionFactory; + CreateFactoryFunc(CreateInfo, ppFactory); + LoadAndCreateSuperResolutionFactory(CreateInfo, ppFactory); +} + +} // namespace Diligent