From b250c8e9c04cd1adccab7a6885273c9e6129131f Mon Sep 17 00:00:00 2001
From: Oliver Wolff <oliver.wolff@theqtcompany.com>
Date: Tue, 1 Mar 2016 14:16:52 +0100
Subject: [PATCH 6/7] ANGLE: Fix Windows Store D3D Trim and Level 9 requirements

Due to additional validation not covered in previous patches, the Windows
Store certification compatibility had regressed. These changes ensure that
the required D3D behaviors are met.

Change-Id: If8bc2f8cd4b2f84e1d92a1627951da2537212125
---
 .../angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp  | 15 ++++++++++++++-
 src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp |  2 ++
 2 files changed, 16 insertions(+), 1 deletion(-)

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 03159bb..ea84783 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
@@ -453,7 +453,20 @@ Renderer11::Renderer11(egl::Display *display)
         if (requestedMajorVersion == 9 && requestedMinorVersion == 3)
 #endif
         {
-            mAvailableFeatureLevels.push_back(D3D_FEATURE_LEVEL_9_3);
+            if (requestedMinorVersion == EGL_DONT_CARE || requestedMinorVersion >= 3)
+            {
+                mAvailableFeatureLevels.push_back(D3D_FEATURE_LEVEL_9_3);
+            }
+#if defined(ANGLE_ENABLE_WINDOWS_STORE)
+            if (requestedMinorVersion == EGL_DONT_CARE || requestedMinorVersion >= 2)
+            {
+                mAvailableFeatureLevels.push_back(D3D_FEATURE_LEVEL_9_2);
+            }
+            if (requestedMinorVersion == EGL_DONT_CARE || requestedMinorVersion >= 1)
+            {
+                mAvailableFeatureLevels.push_back(D3D_FEATURE_LEVEL_9_1);
+            }
+#endif
         }
 
         EGLint requestedDeviceType = attributes.get(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE,
diff --git a/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp b/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
index e3c35d5..6c7e2ff 100644
--- a/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
@@ -50,6 +50,8 @@ EGLBoolean EGLAPIENTRY QuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surfa
     // validate the attribute parameter
     switch (attribute)
     {
+      case EGL_DEVICE_EXT:
+        break;
       case EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE:
         if (!display->getExtensions().surfaceD3DTexture2DShareHandle)
         {
-- 
2.7.0.windows.1

