From 8fb636a0e96d8e377b5cb8897e4927c32e8aab4d Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 19 Jul 2018 23:08:48 -0700 Subject: Fixed D3D11 fences on Windows8.1 --- Graphics/GraphicsEngineD3D11/include/pch.h | 15 +++++++++++++-- Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp | 10 ++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/include/pch.h b/Graphics/GraphicsEngineD3D11/include/pch.h index 7285fd95..2f0f23bb 100644 --- a/Graphics/GraphicsEngineD3D11/include/pch.h +++ b/Graphics/GraphicsEngineD3D11/include/pch.h @@ -39,9 +39,20 @@ #include #include #if PLATFORM_WIN32 - #include +# if _WIN32_WINNT >= 0x0A00 // _WIN32_WINNT_WIN10 +# include +# else +# include +# endif #elif PLATFORM_UNIVERSAL_WINDOWS - #include + #include +#endif + +#if _WIN32_WINNT >= 0x0A00 // _WIN32_WINNT_WIN10 +# define D3D11_FENCES_SUPPORTED 1 +#else +# define D3D11_FENCES_SUPPORTED 0 + using ID3D11Fence = IUnknown; #endif #include "EngineD3D11Defines.h" diff --git a/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp index c090b3b8..1334d51e 100644 --- a/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp @@ -35,6 +35,11 @@ FenceD3D11Impl :: FenceD3D11Impl(IReferenceCounters* pRefCounters, const FenceDesc& Desc) : TFenceBase(pRefCounters, pDevice, Desc) { +#if D3D11_FENCES_SUPPORTED + +#else + LOG_ERROR("D3D11 fences are not supported in this Windows SDK version"); +#endif } FenceD3D11Impl :: ~FenceD3D11Impl() @@ -43,7 +48,12 @@ FenceD3D11Impl :: ~FenceD3D11Impl() Uint64 FenceD3D11Impl :: GetCompletedValue() { +#if D3D11_FENCES_SUPPORTED return m_pd3d11Fence->GetCompletedValue(); +#else + LOG_ERROR("D3D11 fences are not supported in this Windows SDK version"); + return 0; +#endif } void FenceD3D11Impl :: Reset(Uint64 Value) -- cgit v1.2.3