From a96656a8fb6a3c1fc7765659efff28f807fd0deb Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 28 Jul 2017 09:02:50 +0200 Subject: ANGLE: Fix build for newer MinGW versions Availability of D3D11_QUERY_DATA_TIMESTAMP_DISJOINT depends on the used MinGW version so that the check for MINGW is not sufficient. The newly added configure test can be used for every toolset. Task-number: QTBUG-57916 Change-Id: Ia9cb48f3e673841101a93cbc8ea23aff9547f639 Reviewed-by: Oswald Buddenhagen Reviewed-by: Kai Koehne --- .../win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp | 47 ++++++++++++++++++++++ .../win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro | 3 ++ .../src/libANGLE/renderer/d3d/d3d11/Query11.cpp | 2 +- ...GLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch | 32 +++++++++++++++ src/angle/src/common/gles_common.pri | 5 +++ src/gui/configure.json | 10 +++++ 6 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp create mode 100644 config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro create mode 100644 src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch diff --git a/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp new file mode 100644 index 0000000000..2dde2914a2 --- /dev/null +++ b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char**) +{ + D3D11_QUERY_DATA_TIMESTAMP_DISJOINT qdtd; + (void)qdtd; + return 0; +} diff --git a/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro new file mode 100644 index 0000000000..f1e530ab6e --- /dev/null +++ b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro @@ -0,0 +1,3 @@ +SOURCES = angle_d3d11_qdtd.cpp +CONFIG -= qt +CONFIG += console diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp index 972c289412..0a79b26df0 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp @@ -20,7 +20,7 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS { } D3D11_QUERY_DATA_SO_STATISTICS; #endif // ANGLE_MINGW32_COMPAT -#ifdef __MINGW32__ +#ifndef ANGLE_D3D11_QDTD_AVAILABLE typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT { UINT64 Frequency; BOOL Disjoint; diff --git a/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch b/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch new file mode 100644 index 0000000000..9809fefd9d --- /dev/null +++ b/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch @@ -0,0 +1,32 @@ +From 640361e72369d612270c6e59126019c917e33c9a Mon Sep 17 00:00:00 2001 +From: Oliver Wolff +Date: Fri, 28 Jul 2017 09:02:50 +0200 +Subject: [PATCH] ANGLE: Use ANGLE_D3D11_QDTD_AVAILABLE to check struct's + availability + +Checking mingw when defining the structure is not enough, as it is +available in recent versions of MinGW. The define that is used is set +depending on a configure test which works independently of the used +toolchain. + +Change-Id: Ia9cb48f3e673841101a93cbc8ea23aff9547f639 +--- + src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +index 972c289..97c65e1 100644 +--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp ++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +@@ -20,7 +20,7 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS { + } D3D11_QUERY_DATA_SO_STATISTICS; + #endif // ANGLE_MINGW32_COMPAT + +-#ifdef __MINGW32__ ++#ifndef ANGLE_D3D11_QDTD_AVAILABLE + typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT { + UINT64 Frequency; + BOOL Disjoint; +-- +2.10.2.windows.1 + diff --git a/src/angle/src/common/gles_common.pri b/src/angle/src/common/gles_common.pri index 7b2e4c71b0..ea4fb03aae 100644 --- a/src/angle/src/common/gles_common.pri +++ b/src/angle/src/common/gles_common.pri @@ -23,6 +23,11 @@ for(libname, STATICLIBS) { DEFINES += LIBANGLE_IMPLEMENTATION LIBGLESV2_IMPLEMENTATION GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= !winrt: DEFINES += ANGLE_ENABLE_D3D9 ANGLE_SKIP_DXGI_1_2_CHECK +QT_FOR_CONFIG += gui-private +include($$OUT_PWD/../../../gui/qtgui-config.pri) + +qtConfig(angle_d3d11_qdtd): DEFINES += ANGLE_D3D11_QDTD_AVAILABLE + HEADERS += \ $$ANGLE_DIR/src/common/mathutil.h \ $$ANGLE_DIR/src/common/blocklayout.h \ diff --git a/src/gui/configure.json b/src/gui/configure.json index 062171606e..6fdeefe14a 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -591,6 +591,11 @@ }, "tests": { + "angle_d3d11_qdtd": { + "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", + "type": "compile", + "test": "win/angle_d3d11_qdtd" + }, "directwrite2": { "label": "DirectWrite 2", "type": "compile", @@ -842,6 +847,11 @@ { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" } ] }, + "angle_d3d11_qdtd": { + "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", + "condition": "features.angle && tests.angle_d3d11_qdtd", + "output": [ "privateFeature" ] + }, "combined-angle-lib": { "label": "Combined ANGLE Library", "autoDetect": false, -- cgit v1.2.3