Skip to content

Instantly share code, notes, and snippets.

@cristianadam
Created August 18, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cristianadam/3328bfadbdd17838717f4f1919e470ee to your computer and use it in GitHub Desktop.
Save cristianadam/3328bfadbdd17838717f4f1919e470ee to your computer and use it in GitHub Desktop.
Qt 5.15.2 Declarative patch to build with LLVM MinGW.
diff -Naur old/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp new/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
--- old/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp 2020-10-27 09:02:12.000000000 +0100
+++ new/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp 2021-06-17 18:41:00.815070000 +0200
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <initguid.h>
#include "qsgd3d12engine_p.h"
#include "qsgd3d12engine_p_p.h"
#include "cs_mipmapgen.hlslh"
@@ -62,6 +63,7 @@
#endif
#include <comdef.h>
+#include <d3d12sdklayers.h>
QT_BEGIN_NAMESPACE
@@ -221,7 +223,7 @@
if (SUCCEEDED(factory->EnumAdapters1(adapterIndex, &adapter))) {
adapter->GetDesc1(&desc);
const QString name = QString::fromUtf16((char16_t *) desc.Description);
- HRESULT hr = D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr);
+ HRESULT hr = D3D12CreateDevice(adapter.Get(), fl, IID_ID3D12Device, nullptr);
if (SUCCEEDED(hr)) {
qCDebug(QSG_LOG_INFO_GENERAL, "Using requested adapter '%s'", qPrintable(name));
*outAdapter = adapter.Detach();
@@ -238,7 +240,7 @@
if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE)
continue;
- if (SUCCEEDED(D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr))) {
+ if (SUCCEEDED(D3D12CreateDevice(adapter.Get(), fl, IID_ID3D12Device, nullptr))) {
const QString name = QString::fromUtf16((char16_t *) desc.Description);
qCDebug(QSG_LOG_INFO_GENERAL, "Using adapter '%s'", qPrintable(name));
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment