summaryrefslogtreecommitdiffstats
path: root/src/angle/patches/0014-ANGLE-D3D11-Always-execute-QueryInterface.patch
blob: dbe618102edd2c049acedc5751f07626e7a4ee9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 4d1906f0b81f2b61adf9640ae6cef9d503c33209 Mon Sep 17 00:00:00 2001
From: Maurice Kalinowski <maurice.kalinowski@digia.com>
Date: Tue, 3 Dec 2013 14:52:18 +0100
Subject: [PATCH] ANGLE D3D11: Always execute QueryInterface

ASSERT removes the condition when building for release mode. However,
QueryInterface must be called in any case. Adopt to using ASSERT(false)
like in other occurrences in angle.

This is a follow-up patch to 331bc16afd23414493b842819e0b747e8f364243

Change-Id: I4413bab06b5a529fcbd09bbc20828fcdcf4e4fc6
---
 src/3rdparty/angle/src/libEGL/Surface.cpp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/3rdparty/angle/src/libEGL/Surface.cpp b/src/3rdparty/angle/src/libEGL/Surface.cpp
index ee8d480..99d0c1d 100644
--- a/src/3rdparty/angle/src/libEGL/Surface.cpp
+++ b/src/3rdparty/angle/src/libEGL/Surface.cpp
@@ -118,7 +118,12 @@ bool Surface::resetSwapChain()
 #else
         ABI::Windows::Foundation::Rect windowRect;
         ABI::Windows::UI::Core::ICoreWindow *window;
-        ASSERT(SUCCEEDED(mWindow->QueryInterface(IID_PPV_ARGS(&window))));
+        HRESULT result = mWindow->QueryInterface(IID_PPV_ARGS(&window));
+        if (FAILED(result))
+        {
+            ASSERT(false);
+            return false;
+        }
         window->get_Bounds(&windowRect);
         width = windowRect.Width;
         height = windowRect.Height;
@@ -342,7 +347,12 @@ bool Surface::checkForOutOfDateSwapChain()
 #else
     ABI::Windows::Foundation::Rect windowRect;
     ABI::Windows::UI::Core::ICoreWindow *window;
-    ASSERT(SUCCEEDED(mWindow->QueryInterface(IID_PPV_ARGS(&window))));
+    HRESULT result = mWindow->QueryInterface(IID_PPV_ARGS(&window));
+    if (FAILED(result))
+    {
+        ASSERT(false);
+        return false;
+    }
     window->get_Bounds(&windowRect);
     int clientWidth = windowRect.Width;
     int clientHeight = windowRect.Height;
-- 
1.7.11.msysgit.0