summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-20 06:08:48 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-20 06:08:48 +0000
commit8fb636a0e96d8e377b5cb8897e4927c32e8aab4d (patch)
tree2abb859df5c4c8fdf3ffb695e87ed4658bed3c76 /Graphics/GraphicsEngineD3D11
parentAdded fence object stubs + code formatting (diff)
downloadDiligentCore-8fb636a0e96d8e377b5cb8897e4927c32e8aab4d.tar.gz
DiligentCore-8fb636a0e96d8e377b5cb8897e4927c32e8aab4d.zip
Fixed D3D11 fences on Windows8.1
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/include/pch.h15
-rw-r--r--Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp10
2 files changed, 23 insertions, 2 deletions
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 <exception>
#include <algorithm>
#if PLATFORM_WIN32
- #include <d3d11.h>
+# if _WIN32_WINNT >= 0x0A00 // _WIN32_WINNT_WIN10
+# include <d3d11_3.h>
+# else
+# include <d3d11.h>
+# endif
#elif PLATFORM_UNIVERSAL_WINDOWS
- #include <d3d11_2.h>
+ #include <d3d11_3.h>
+#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)