diff --git a/.github/workflows/scripts/windows/build-dependencies.bat b/.github/workflows/scripts/windows/build-dependencies.bat index 6cfcd85eaf..d4a1b12a3d 100644 --- a/.github/workflows/scripts/windows/build-dependencies.bat +++ b/.github/workflows/scripts/windows/build-dependencies.bat @@ -97,6 +97,7 @@ set SHADERC_SPIRVHEADERS=58006c901d1d5c37dece6b6610e9af87fa951375 set SHADERC_SPIRVTOOLS=6337eb62cadd7d124ac6789bf39c0f71148f0a73 set AGILITYSDK=1.619.2 +set DXHEADERS=1.619.1 call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 3529cc37297a5a7aae4486843b9fd41c30df1d79a770f85e240b537dcc327ca5 || goto error call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 37fba768f2780580dfae535ad6654cb9dc0bf2272e71b9b9781988de9ed0dac0 || goto error @@ -129,6 +130,7 @@ call :downloadfile "KDDockWidgets-%KDDOCKWIDGETS%.zip" "https://github.com/KDAB/ call :downloadfile "plutovg-%PLUTOVG%.zip" "https://github.com/sammycage/plutovg/archive/v%PLUTOVG%.zip" 4fe4e48f28aa80171b2166d45c0976ab0f21eecedb52cd4c3ef73b5afb48fac9 || goto error call :downloadfile "plutosvg-%PLUTOSVG%.zip" "https://github.com/sammycage/plutosvg/archive/v%PLUTOSVG%.zip" 82dee2c57ad712bdd6d6d81d3e76249d89caa4b5a4214353660fd5adff12201a || goto error call :downloadfile "agility-sdk-%AGILITYSDK%.nupkg" "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/%AGILITYSDK%" eb92d90bb23b2ec23410c41d791e41dbdbec942ab946924d1fdcb31eac6f0735 || goto error +call :downloadfile "DirectX-Headers-%DXHEADERS%.zip" "https://github.com/microsoft/DirectX-Headers/archive/v%DXHEADERS%.zip" 9eb8b102a90a42e4ea72a825f7d249d55ec90d164f030966c9b7784b93374927 || goto error call :downloadfile "rapidyaml-%RAPIDYAML%-src.zip" "https://github.com/biojppm/rapidyaml/releases/download/v%RAPIDYAML%/rapidyaml-%RAPIDYAML%-src.zip" 96276f55b9fa7837ac8f3f72fd52965879cbb5d5d2e6af548c69a177fb078304 || goto error call :downloadfile "shaderc-%SHADERC%.zip" "https://github.com/google/shaderc/archive/refs/tags/v%SHADERC%.zip" f9401cc5cb36c276cd1e072b6595dbd728148e8dba389e50f7339e2d388dbc08 || goto error @@ -507,6 +509,16 @@ if %DEBUG%==1 ( ) cd .. || goto error +rem DirectX Headers include a CMakeList file, which is absent in the Nuget package +echo Unpacking DirectX Headers +rmdir /S /Q "DirectX-Headers-%DXHEADERS%" +%SEVENZIP% x "DirectX-Headers-%DXHEADERS%.zip" || goto error +cd "DirectX-Headers-%DXHEADERS%" || goto error +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DDXHEADERS_BUILD_TEST=OFF -DDXHEADERS_BUILD_GOOGLE_TEST=OFF -B build -G Ninja || goto error +cmake --build build --parallel || goto error +ninja -C build install || goto error +cd .. || goto error + echo Building shaderc... rmdir /S /Q "shaderc-%SHADERC%" %SEVENZIP% x "shaderc-%SHADERC%.zip" || goto error diff --git a/3rdparty/d3d12memalloc/CMakeLists.txt b/3rdparty/d3d12memalloc/CMakeLists.txt index ac9bc5478a..a26c925804 100644 --- a/3rdparty/d3d12memalloc/CMakeLists.txt +++ b/3rdparty/d3d12memalloc/CMakeLists.txt @@ -3,5 +3,7 @@ add_library(D3D12MemAlloc src/D3D12MemAlloc.cpp ) +target_link_libraries(D3D12MemAlloc PRIVATE Microsoft::DirectX-Headers) + target_include_directories(D3D12MemAlloc PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") disable_compiler_warnings_for_target(D3D12MemAlloc) diff --git a/3rdparty/d3d12memalloc/d3d12memalloc.vcxproj b/3rdparty/d3d12memalloc/d3d12memalloc.vcxproj index 8dfe046dd3..5b2b2dc9a1 100644 --- a/3rdparty/d3d12memalloc/d3d12memalloc.vcxproj +++ b/3rdparty/d3d12memalloc/d3d12memalloc.vcxproj @@ -20,6 +20,7 @@ + @@ -37,9 +38,9 @@ - %(PreprocessorDefinitions) + D3D12MA_USING_DIRECTX_HEADERS;%(PreprocessorDefinitions) TurnOffAllWarnings - $(ProjectDir)include;$(ProjectDir)src;%(AdditionalIncludeDirectories) + $(DepsIncludeDir);$(ProjectDir)include;$(ProjectDir)src;%(AdditionalIncludeDirectories) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 8407e6393c..f3b71b7dd2 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -22,6 +22,9 @@ find_package(Freetype 2.10 REQUIRED) # 2.10 is the first with COLRv0 support, wh find_package(plutovg 1.1.0 REQUIRED) find_package(plutosvg 0.0.7 REQUIRED) find_package(ryml REQUIRED) +if (WIN32) + find_package(DirectX-Headers 1.618.1 REQUIRED) +endif() if(USE_VULKAN) find_package(Shaderc REQUIRED) diff --git a/common/vsprops/DepsDir.props b/common/vsprops/DepsDir.props new file mode 100644 index 0000000000..00aaf124a3 --- /dev/null +++ b/common/vsprops/DepsDir.props @@ -0,0 +1,10 @@ + + + + $(SolutionDir)deps\ + $(SolutionDir)deps-arm64\ + $(DepsRootDir)bin\ + $(DepsRootDir)lib\ + $(DepsRootDir)include\ + + diff --git a/common/vsprops/common.props b/common/vsprops/common.props index 9b0a030d19..e605d17109 100644 --- a/common/vsprops/common.props +++ b/common/vsprops/common.props @@ -1,5 +1,8 @@  + + + -avx2 @@ -15,11 +18,6 @@ $(SolutionDir)build\lib-$(PlatformName)-$(Configuration)\ $(SolutionDir)build\obj-$(ProjectName)-$(PlatformName)-$(Configuration)\ - $(SolutionDir)deps\ - $(SolutionDir)deps-arm64\ - $(DepsRootDir)bin\ - $(DepsRootDir)lib\ - $(DepsRootDir)include\ false diff --git a/pcsx2/GS/Renderers/DX11/D3D.cpp b/pcsx2/GS/Renderers/DX11/D3D.cpp index 96414df850..87c3087502 100644 --- a/pcsx2/GS/Renderers/DX11/D3D.cpp +++ b/pcsx2/GS/Renderers/DX11/D3D.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/pcsx2/GS/Renderers/DX12/D3D12Builders.h b/pcsx2/GS/Renderers/DX12/D3D12Builders.h index 97e4634f90..913c098989 100644 --- a/pcsx2/GS/Renderers/DX12/D3D12Builders.h +++ b/pcsx2/GS/Renderers/DX12/D3D12Builders.h @@ -8,7 +8,7 @@ #include "common/RedtapeWilCom.h" #include -#include +#include #include class D3D12ShaderCache; diff --git a/pcsx2/GS/Renderers/DX12/D3D12DescriptorHeapManager.h b/pcsx2/GS/Renderers/DX12/D3D12DescriptorHeapManager.h index 59f4b8b5ad..f97ca81634 100644 --- a/pcsx2/GS/Renderers/DX12/D3D12DescriptorHeapManager.h +++ b/pcsx2/GS/Renderers/DX12/D3D12DescriptorHeapManager.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/pcsx2/GS/Renderers/DX12/D3D12ShaderCache.h b/pcsx2/GS/Renderers/DX12/D3D12ShaderCache.h index f859108460..3b6422c1d6 100644 --- a/pcsx2/GS/Renderers/DX12/D3D12ShaderCache.h +++ b/pcsx2/GS/Renderers/DX12/D3D12ShaderCache.h @@ -10,7 +10,7 @@ #include "common/RedtapeWilCom.h" #include -#include +#include #include #include #include diff --git a/pcsx2/GS/Renderers/DX12/D3D12StreamBuffer.h b/pcsx2/GS/Renderers/DX12/D3D12StreamBuffer.h index 8ec2752012..e6d0c06429 100644 --- a/pcsx2/GS/Renderers/DX12/D3D12StreamBuffer.h +++ b/pcsx2/GS/Renderers/DX12/D3D12StreamBuffer.h @@ -8,7 +8,7 @@ #include "common/RedtapeWilCom.h" #include "common/Assertions.h" -#include +#include #include #include diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index fafd7b4415..bea4b5863a 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -1442,6 +1442,7 @@ bool GSDevice12::CheckFeatures(const u32& vendor_id) m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(D3D12_FEATURE_DATA_D3D12_OPTIONS)); m_features.rov = options.ROVsSupported; + Console.WriteLnFmt("D3D12: Tight Alignment: {}", m_allocator->IsTightAlignmentSupported() ? "Supported" : "Not Supported"); return true; } diff --git a/pcsx2/pcsx2.vcxproj b/pcsx2/pcsx2.vcxproj index 246280513a..5dcf68fcc1 100644 --- a/pcsx2/pcsx2.vcxproj +++ b/pcsx2/pcsx2.vcxproj @@ -62,7 +62,7 @@ Use PrecompiledHeader.h PrecompiledHeader.h;%(ForcedIncludeFiles) - C4_NO_DEBUG_BREAK;ST_NO_EXCEPTION_HANDLING;%(PreprocessorDefinitions) + C4_NO_DEBUG_BREAK;ST_NO_EXCEPTION_HANDLING;D3D12MA_USING_DIRECTX_HEADERS;%(PreprocessorDefinitions) ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions) XBYAK_NO_EXCEPTION;ZYCORE_STATIC_BUILD;ZYDIS_STATIC_BUILD;%(PreprocessorDefinitions) VIXL_INCLUDE_TARGET_AARCH64;%(PreprocessorDefinitions)