forked from qt/qtbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ANGLE: Fix initialization of zero-sized window
The clientRect might be empty when creating a window of zero size. The side effect of a division by zero is that matrix transformation fails and hence the swapchain gets into an invalid state. Change-Id: Idbaed72deadb7b87052ac27e194a40d1810e6f7a Reviewed-by: Andrew Knight <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>
- Loading branch information
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/angle/patches/0012-ANGLE-Fix-initialization-of-zero-sized-window.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 79d2bac44cb2a0793c00886f0499422ab6ffa09c Mon Sep 17 00:00:00 2001 | ||
From: Maurice Kalinowski <[email protected]> | ||
Date: Fri, 12 Aug 2016 08:11:16 +0200 | ||
Subject: [PATCH] ANGLE: Fix initialization of zero-sized window | ||
|
||
The clientRect might be empty when creating a window of zero size. The | ||
side effect of a division by zero is that matrix transformation fails | ||
and hence the swapchain gets into an invalid state. | ||
|
||
Change-Id: Idbaed72deadb7b87052ac27e194a40d1810e6f7a | ||
--- | ||
.../libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp | ||
index d3ed35b..548b460 100644 | ||
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp | ||
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp | ||
@@ -322,8 +322,8 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, | ||
|
||
HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const Size &windowSize, const RECT &clientRect) | ||
{ | ||
- Size renderScale = {windowSize.Width / clientRect.right, | ||
- windowSize.Height / clientRect.bottom}; | ||
+ Size renderScale = {windowSize.Width / std::max(LONG(1), clientRect.right), | ||
+ windowSize.Height / std::max(LONG(1), clientRect.bottom)}; | ||
// Setup a scale matrix for the swap chain | ||
DXGI_MATRIX_3X2_F scaleMatrix = {}; | ||
scaleMatrix._11 = renderScale.Width; | ||
-- | ||
2.9.2.windows.1 | ||
|