summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}