summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTriang3l <triang3l@yandex.ru>2026-01-14 23:05:08 +0300
committerTriang3l <triang3l@yandex.ru>2026-01-14 23:05:08 +0300
commitc4e1242fa26f55c260f2b030e43ffc8a5ac5d0b7 (patch)
tree4c89a447c3add047c8c5556eda20ab2148031215
parent9535e610b0996e0b29d19d6a2ad788edba7c2c63 (diff)
[D3D12] Include recent D3D12 headers from the Microsoft GitHub
-rw-r--r--.gitmodules3
-rw-r--r--src/xenia/ui/d3d12/d3d12_api.h12
-rw-r--r--src/xenia/ui/dxgi_include_win.h23
-rw-r--r--src/xenia/ui/presenter.h3
-rw-r--r--src/xenia/ui/window_win.h3
m---------third_party/DirectX-Headers0
6 files changed, 39 insertions, 5 deletions
diff --git a/.gitmodules b/.gitmodules
index c27065533..89cc18110 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -85,3 +85,6 @@
[submodule "third_party/VulkanMemoryAllocator"]
path = third_party/VulkanMemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
+[submodule "third_party/DirectX-Headers"]
+ path = third_party/DirectX-Headers
+ url = https://github.com/microsoft/DirectX-Headers.git
diff --git a/src/xenia/ui/d3d12/d3d12_api.h b/src/xenia/ui/d3d12/d3d12_api.h
index 82bc44bff..98eb495da 100644
--- a/src/xenia/ui/d3d12/d3d12_api.h
+++ b/src/xenia/ui/d3d12/d3d12_api.h
@@ -13,11 +13,17 @@
// Must be included before D3D and DXGI for things like NOMINMAX.
#include "xenia/base/platform_win.h"
+// Include the up to date versions of the headers of DXGI and Direct3D 12 rather
+// than the ones from the Windows SDK before other headers that may also
+// potentially include their headers.
+
+#include "xenia/ui/dxgi_include_win.h"
+
+#include "third_party/DirectX-Headers/include/directx/d3d12.h"
+#include "third_party/DirectX-Headers/include/directx/d3d12sdklayers.h"
+
#include <DXProgrammableCapture.h>
-#include <d3d12.h>
-#include <d3d12sdklayers.h>
#include <d3dcompiler.h>
-#include <dxgi1_5.h>
#include <dxgidebug.h>
// For Microsoft::WRL::ComPtr.
#include <wrl/client.h>
diff --git a/src/xenia/ui/dxgi_include_win.h b/src/xenia/ui/dxgi_include_win.h
new file mode 100644
index 000000000..58347b019
--- /dev/null
+++ b/src/xenia/ui/dxgi_include_win.h
@@ -0,0 +1,23 @@
+/**
+ ******************************************************************************
+ * Xenia : Xbox 360 Emulator Research Project *
+ ******************************************************************************
+ * Copyright 2026 Ben Vanik. All rights reserved. *
+ * Released under the BSD license - see LICENSE in the root for more details. *
+ ******************************************************************************
+ */
+
+#ifndef XENIA_UI_DXGI_INCLUDE_WIN_H_
+#define XENIA_UI_DXGI_INCLUDE_WIN_H_
+
+// Must be included before Windows headers for definitions like NOMINMAX.
+#include "xenia/base/platform_win.h"
+
+// Include the up to date versions of the DXGI header dependencies rather than
+// the ones from the Windows SDK before including the DXGI header.
+#include "third_party/DirectX-Headers/include/directx/dxgicommon.h"
+#include "third_party/DirectX-Headers/include/directx/dxgiformat.h"
+
+#include <dxgi1_5.h>
+
+#endif // XENIA_UI_DXGI_INCLUDE_WIN_H_
diff --git a/src/xenia/ui/presenter.h b/src/xenia/ui/presenter.h
index 9862546ab..b1d38224e 100644
--- a/src/xenia/ui/presenter.h
+++ b/src/xenia/ui/presenter.h
@@ -39,7 +39,8 @@
// Windows handle types.
#include "xenia/base/platform_win.h"
-#include <dxgi.h>
+#include "xenia/ui/dxgi_include_win.h"
+
#include <wrl/client.h>
#endif // XE_PLATFORM
diff --git a/src/xenia/ui/window_win.h b/src/xenia/ui/window_win.h
index dd5d8b978..38c50a061 100644
--- a/src/xenia/ui/window_win.h
+++ b/src/xenia/ui/window_win.h
@@ -19,8 +19,9 @@
// Must be included before Windows headers for things like NOMINMAX.
#include "xenia/base/platform_win.h"
+#include "xenia/ui/dxgi_include_win.h"
+
#include <ShellScalingApi.h>
-#include <dxgi.h>
namespace xe {
namespace ui {
diff --git a/third_party/DirectX-Headers b/third_party/DirectX-Headers
new file mode 160000
+Subproject 33374754f65baac0500dda6187e371136357246