summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2016-05-11 13:51:54 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2016-05-12 12:15:42 +0000
commitd8d4129c1b4be6a62ec17d0418ff7a37be451d4c (patch)
treeaf66773ea0ff056134af97513fefa844586d9c10 /src/3rdparty
parent864380639b9cf563c2399b30f816ed1a25fa3ba6 (diff)
ANGLE: Disable support for shared handles in warp mode on Windows < 8
Shared handles are not supported on Windows 7 and below. If the according flag is set CreateTexture2D will fail with E_OUTOFMEMORY. The check already happens with newer ANGLE versions, which we use in 5.7 but has to happen here as well. Otherwise Qt applications running on Windows 7 and below will crash at startup. Change-Id: I8f539f16dce298611fb1ec7b2f6804d4a04d04e0 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
index 223e2b019b..dd554f4f38 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
@@ -2370,6 +2370,19 @@ unsigned int Renderer11::getReservedFragmentUniformBuffers() const
bool Renderer11::getShareHandleSupport() const
{
+ if (mDriverType == D3D_DRIVER_TYPE_WARP)
+ {
+#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
+ // Warp mode does not support shared handles in Windows versions below Windows 8
+ OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}};
+ if (GetVersionEx(&result) &&
+ ((result.dwMajorVersion == 6 && result.dwMinorVersion < 2) || result.dwMajorVersion < 6))
+ {
+ // WARP on Windows 7 doesn't support shared handles
+ return false;
+ }
+#endif // ANGLE_ENABLE_WINDOWS_STORE
+ }
// We only currently support share handles with BGRA surfaces, because
// chrome needs BGRA. Once chrome fixes this, we should always support them.
// PIX doesn't seem to support using share handles, so disable them.