diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-11-09 01:56:44 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-11-09 01:56:44 +0000 |
| commit | b360883a60ddbb169a9184428966db82b6dd96e9 (patch) | |
| tree | b62cd9d946744d576cb1ab01f22c8e9aa230817b /Graphics | |
| parent | Fixed gcc build error (diff) | |
| download | DiligentCore-b360883a60ddbb169a9184428966db82b6dd96e9.tar.gz DiligentCore-b360883a60ddbb169a9184428966db82b6dd96e9.zip | |
Added APIVersion member to EngineCreateInfo struct (API Version 240040)
Diffstat (limited to 'Graphics')
6 files changed, 29 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngine/interface/APIInfo.h b/Graphics/GraphicsEngine/interface/APIInfo.h index 70de6f5a..b59997de 100644 --- a/Graphics/GraphicsEngine/interface/APIInfo.h +++ b/Graphics/GraphicsEngine/interface/APIInfo.h @@ -26,7 +26,7 @@ /// \file /// Diligent API information -#define DILIGENT_API_VERSION 240039 +#define DILIGENT_API_VERSION 240040 #include "../../../Primitives/interface/BasicTypes.h" diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h index 7d75f8a1..3ad73227 100644 --- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h +++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h @@ -29,6 +29,7 @@ #include "../../../Primitives/interface/BasicTypes.h" #include "../../../Primitives/interface/DebugOutput.h" #include "../../../Primitives/interface/FlagEnum.h" +#include "APIInfo.h" /// Graphics engine namespace namespace Diligent @@ -1272,6 +1273,9 @@ namespace Diligent /// Engine creation attibutes struct EngineCreateInfo { + /// API version number. + Int32 APIVersion = DILIGENT_API_VERSION; + /// Pointer to the raw memory allocator that will be used for all memory allocation/deallocation /// operations in the engine class IMemoryAllocator* pRawMemAllocator = nullptr; diff --git a/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp index a89910f3..01e8e913 100644 --- a/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp +++ b/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp @@ -99,6 +99,9 @@ void EngineFactoryD3D11Impl::CreateDeviceAndContextsD3D11(const EngineD3D11Creat IRenderDevice** ppDevice, IDeviceContext** ppContexts) { + if (EngineCI.APIVersion != DILIGENT_API_VERSION) + LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + if (EngineCI.DebugMessageCallback != nullptr) SetDebugMessageCallback(EngineCI.DebugMessageCallback); @@ -202,6 +205,9 @@ void EngineFactoryD3D11Impl::AttachToD3D11Device(void* pd IRenderDevice** ppDevice, IDeviceContext** ppContexts) { + if (EngineCI.APIVersion != DILIGENT_API_VERSION) + LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + if (EngineCI.DebugMessageCallback != nullptr) SetDebugMessageCallback(EngineCI.DebugMessageCallback); diff --git a/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp index 6c545d9d..6b16a440 100644 --- a/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp @@ -107,6 +107,9 @@ void EngineFactoryD3D12Impl::CreateDeviceAndContextsD3D12(const EngineD3D12Creat IRenderDevice** ppDevice, IDeviceContext** ppContexts) { + if (EngineCI.APIVersion != DILIGENT_API_VERSION) + LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + if (EngineCI.DebugMessageCallback != nullptr) SetDebugMessageCallback(EngineCI.DebugMessageCallback); @@ -307,6 +310,9 @@ void EngineFactoryD3D12Impl::AttachToD3D12Device(void* pd IRenderDevice** ppDevice, IDeviceContext** ppContexts) { + if (EngineCI.APIVersion != DILIGENT_API_VERSION) + LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + if (EngineCI.DebugMessageCallback != nullptr) SetDebugMessageCallback(EngineCI.DebugMessageCallback); diff --git a/Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp b/Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp index fca37d8e..5e314f28 100644 --- a/Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp @@ -110,6 +110,9 @@ void EngineFactoryOpenGLImpl::CreateDeviceAndSwapChainGL(const EngineGLCreateInf const SwapChainDesc& SCDesc, ISwapChain** ppSwapChain) { + if (EngineCI.APIVersion != DILIGENT_API_VERSION) + LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + if (EngineCI.DebugMessageCallback != nullptr) SetDebugMessageCallback(EngineCI.DebugMessageCallback); @@ -187,6 +190,9 @@ void EngineFactoryOpenGLImpl::AttachToActiveGLContext(const EngineGLCreateInfo& IRenderDevice** ppDevice, IDeviceContext** ppImmediateContext ) { + if (EngineCI.APIVersion != DILIGENT_API_VERSION) + LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + if (EngineCI.DebugMessageCallback != nullptr) SetDebugMessageCallback(EngineCI.DebugMessageCallback); diff --git a/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp index d1219207..496eb67f 100644 --- a/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp +++ b/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp @@ -87,6 +87,9 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk(const EngineVkCreateInfo& _E IRenderDevice** ppDevice, IDeviceContext** ppContexts) { + if (_EngineCI.APIVersion != DILIGENT_API_VERSION) + LOG_ERROR_AND_THROW("Diligent Engine runtime (", _EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + VERIFY( ppDevice && ppContexts, "Null pointer provided" ); if( !ppDevice || !ppContexts ) return; @@ -241,6 +244,9 @@ void EngineFactoryVkImpl::AttachToVulkanDevice(std::shared_ptr<VulkanUtilities:: IRenderDevice** ppDevice, IDeviceContext** ppContexts) { + if (EngineCI.APIVersion != DILIGENT_API_VERSION) + LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + VERIFY( ppCommandQueues && ppDevice && ppContexts, "Null pointer provided" ); if(!LogicalDevice || !ppCommandQueues || !ppDevice || !ppContexts ) return; |
