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>
This commit is contained in:
parent
993907d299
commit
0ddf86236e
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user