File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed
Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 3030// / Defines Diligent::IRenderStateCache interface
3131
3232#include " ../../GraphicsEngine/interface/RenderDevice.h"
33+ #include " ArchiverFactory.h"
3334
3435DILIGENT_BEGIN_NAMESPACE (Diligent)
3536
@@ -76,6 +77,9 @@ struct RenderStateCacheCreateInfo
7677 // / shaders. If null, original source factory will be used.
7778 IShaderSourceInputStreamFactory* pReloadSource DEFAULT_INITIALIZER (nullptr );
7879
80+ // / Let user decide how to get archiver factory, either Load DLL or static link
81+ IArchiverFactory* pArchiverFactory DEFAULT_INITIALIZER (nullptr );
82+
7983#if DILIGENT_CPP_INTERFACE
8084 constexpr RenderStateCacheCreateInfo () noexcept
8185 {}
Original file line number Diff line number Diff line change 3838
3939#include " Archiver.h"
4040#include " Dearchiver.h"
41- #include " ArchiverFactory.h"
42- #include " ArchiverFactoryLoader.h"
4341
4442#include " PipelineStateBase.hpp"
4543#include " RefCntAutoPtr.hpp"
@@ -179,16 +177,8 @@ RenderStateCacheImpl::RenderStateCacheImpl(IReferenceCounters* pRe
179177 if (CreateInfo.pDevice == nullptr )
180178 LOG_ERROR_AND_THROW (" CreateInfo.pDevice must not be null" );
181179
182- IArchiverFactory* pArchiverFactory = nullptr ;
183- #if EXPLICITLY_LOAD_ARCHIVER_FACTORY_DLL
184- auto GetArchiverFactory = LoadArchiverFactory ();
185- if (GetArchiverFactory != nullptr )
186- {
187- pArchiverFactory = GetArchiverFactory ();
188- }
189- #else
190- pArchiverFactory = GetArchiverFactory ();
191- #endif
180+ IArchiverFactory* pArchiverFactory = CreateInfo.pArchiverFactory ;
181+
192182 VERIFY_EXPR (pArchiverFactory != nullptr );
193183
194184 SerializationDeviceCreateInfo SerializationDeviceCI;
@@ -964,6 +954,11 @@ Uint32 RenderStateCacheImpl::Reload(ReloadGraphicsPipelineCallbackType ReloadGra
964954
965955static constexpr char RenderStateCacheFileExtension[] = " .diligentcache" ;
966956
957+ // Fix <Windows.h> conflict
958+ #ifdef CreateDirectory
959+ # undef CreateDirectory
960+ #endif
961+
967962std::string GetRenderStateCacheFilePath (const char * CacheLocation, const char * AppName, RENDER_DEVICE_TYPE DeviceType)
968963{
969964 if (CacheLocation == nullptr )
You can’t perform that action at this time.
0 commit comments