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 -#include -#include #include -#include #include // For Microsoft::WRL::ComPtr. #include 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 + +#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 +#include "xenia/ui/dxgi_include_win.h" + #include #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 -#include namespace xe { namespace ui { diff --git a/third_party/DirectX-Headers b/third_party/DirectX-Headers new file mode 160000 index 000000000..33374754f --- /dev/null +++ b/third_party/DirectX-Headers @@ -0,0 +1 @@ +Subproject commit 33374754f65baac0500dda6187e371136357246f