summaryrefslogtreecommitdiffstats
path: root/src/angle
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2014-03-26 14:15:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-28 07:58:47 +0100
commit0ddf86236e1922811a6147ba9b4aa1d59863b785 (patch)
tree85021874134c46f6a5adfa0dab9c82dee8517bea /src/angle
parent993907d29925e5d436de8f4d3b15fc74511c2e67 (diff)
d3dcompiler_qt: Directly link the d3dcompiler DLL on WinRT 8.1
The compiler DLL is a system module starting with Windows 8.1, so directly link to it instead of expecting a packaged DLL. This makes shader precompilation completely optional on this platform. Change-Id: I46cd175ac32e4909a518a059721241b1d6e7be17 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Diffstat (limited to 'src/angle')
-rw-r--r--src/angle/src/d3dcompiler/d3dcompiler.pro5
-rw-r--r--src/angle/src/d3dcompiler/main.cpp11
2 files changed, 15 insertions, 1 deletions
diff --git a/src/angle/src/d3dcompiler/d3dcompiler.pro b/src/angle/src/d3dcompiler/d3dcompiler.pro
index 5a10187279..4d22080185 100644
--- a/src/angle/src/d3dcompiler/d3dcompiler.pro
+++ b/src/angle/src/d3dcompiler/d3dcompiler.pro
@@ -9,6 +9,11 @@ DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
SOURCES += main.cpp
win32:!winrt: LIBS += -lole32
+winrt:equals(WINSDK_VER, 8.1) {
+ DEFINES += D3DCOMPILER_LINKED
+ LIBS += -ld3dcompiler
+}
+
# __stdcall exports get mangled, so use a def file
DEF_FILE += $${TARGET}.def
diff --git a/src/angle/src/d3dcompiler/main.cpp b/src/angle/src/d3dcompiler/main.cpp
index 7742596226..47f80af7d3 100644
--- a/src/angle/src/d3dcompiler/main.cpp
+++ b/src/angle/src/d3dcompiler/main.cpp
@@ -52,6 +52,12 @@
#include <qt_windows.h>
#include <d3dcommon.h>
+#ifdef D3DCOMPILER_LINKED
+namespace D3D {
+# include <d3dcompiler.h>
+}
+#endif // D3DCOMPILER_LINKED
+
Q_LOGGING_CATEGORY(QT_D3DCOMPILER, "qt.angle.d3dcompiler")
namespace D3DCompiler {
@@ -127,6 +133,7 @@ private:
static bool loadCompiler()
{
+#ifndef D3DCOMPILER_LINKED
static HMODULE d3dcompiler = 0;
if (!d3dcompiler) {
const wchar_t *dllNames[] = {
@@ -157,7 +164,9 @@ static bool loadCompiler()
if (!d3dcompiler)
qCDebug(QT_D3DCOMPILER) << "Unable to load D3D shader compiler.";
}
-
+#else // !D3DCOMPILER_LINKED
+ compile = &D3D::D3DCompile;
+#endif // D3DCOMPILER_LINKED
return bool(compile);
}