Warning, /graphics/krita/3rdparty/ext_googleangle/01-patches_qt5.12.12/0009-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch is written in an unsupported language. File is not indexed.
0001 From 97ecbd358af7a06713b03ba418359dbeeddb9d6a Mon Sep 17 00:00:00 2001
0002 From: Oliver Wolff <oliver.wolff@qt.io>
0003 Date: Mon, 10 Dec 2018 08:33:14 +0100
0004 Subject: [PATCH 09/17] ANGLE: Dynamically load D3D compiler from a list
0005
0006 If the default compiler cannot be found, load it from a list of DLL names,
0007 including a non-versioned proxy DLL provided by Qt. On Desktop Windows,
0008 the default compiler can also be specified by an environment variable,
0009 QT_D3DCOMPILER_DLL.
0010 ---
0011 src/libANGLE/renderer/d3d/HLSLCompiler.cpp | 25 ++++++++++++++++++++++
0012 1 file changed, 25 insertions(+)
0013
0014 diff --git a/src/libANGLE/renderer/d3d/HLSLCompiler.cpp b/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
0015 index 38e52eae0..8e8c9fc56 100644
0016 --- a/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
0017 +++ b/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
0018 @@ -16,6 +16,10 @@
0019 #include "libANGLE/renderer/d3d/ContextD3D.h"
0020 #include "libANGLE/trace.h"
0021
0022 +#ifndef QT_D3DCOMPILER_DLL
0023 +#define QT_D3DCOMPILER_DLL D3DCOMPILER_DLL_W
0024 +#endif
0025 +
0026 namespace
0027 {
0028 #if ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED
0029 @@ -136,6 +140,27 @@ angle::Result HLSLCompiler::ensureInitialized(d3d::Context *context)
0030 }
0031 # endif // ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES
0032
0033 + // Load the compiler DLL specified by the environment, or default to QT_D3DCOMPILER_DLL
0034 + const wchar_t *defaultCompiler = _wgetenv(L"QT_D3DCOMPILER_DLL");
0035 + if (!defaultCompiler)
0036 + defaultCompiler = QT_D3DCOMPILER_DLL;
0037 +
0038 + const wchar_t *compilerDlls[] = {
0039 + defaultCompiler,
0040 + L"d3dcompiler_47.dll",
0041 + L"d3dcompiler_46.dll",
0042 + L"d3dcompiler_43.dll",
0043 + 0
0044 + };
0045 +
0046 + // Load the first available known compiler DLL
0047 + for (int i = 0; compilerDlls[i]; ++i)
0048 + {
0049 + mD3DCompilerModule = LoadLibraryW(compilerDlls[i]);
0050 + if (mD3DCompilerModule)
0051 + break;
0052 + }
0053 +
0054 if (!mD3DCompilerModule)
0055 {
0056 // Load the version of the D3DCompiler DLL associated with the Direct3D version ANGLE was
0057 --
0058 2.24.1.windows.2
0059