From a21519b37dd9a2b26871643745112a8aeb7cad91 Mon Sep 17 00:00:00 2001 From: Nukem Date: Wed, 5 Jun 2024 15:42:55 -0400 Subject: [PATCH] Use a precompiled header in dxvk and d3d9 subprojects --- src/d3d9/meson.build | 7 ++++++- src/d3d9/pch/d3d9_pch.h | 1 + src/dxvk/meson.build | 7 ++++++- src/dxvk/pch/dxvk_pch.h | 1 + src/dxvk/rtx_render/rtx_ngx_wrapper.cpp | 2 ++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/d3d9/pch/d3d9_pch.h create mode 100644 src/dxvk/pch/dxvk_pch.h diff --git a/src/d3d9/meson.build b/src/d3d9/meson.build index 34731fb10..cccd9590d 100644 --- a/src/d3d9/meson.build +++ b/src/d3d9/meson.build @@ -91,6 +91,10 @@ d3d9_src = [ 'd3d9_swapchain_external.cpp', ] +d3d9_pch = [ + 'pch/d3d9_pch.h', +] + d3d9_dll = shared_library('d3d9', d3d9_src, dxvk_version, glsl_generator.process(d3d9_shaders), d3d9_res, name_prefix : '', link_with : [ util_lib ], @@ -99,7 +103,8 @@ d3d9_dll = shared_library('d3d9', d3d9_src, dxvk_version, glsl_generator.process install : true, objects : not dxvk_is_msvc ? 'd3d9' + def_spec_ext : [], vs_module_defs : 'd3d9'+def_spec_ext, - override_options : ['cpp_std='+dxvk_cpp_std]) + override_options : ['cpp_std='+dxvk_cpp_std], + cpp_pch : d3d9_pch) d3d9_dep = declare_dependency( link_with : [ d3d9_dll ], diff --git a/src/d3d9/pch/d3d9_pch.h b/src/d3d9/pch/d3d9_pch.h new file mode 100644 index 000000000..e3f1a698b --- /dev/null +++ b/src/d3d9/pch/d3d9_pch.h @@ -0,0 +1 @@ +#include "../dxvk/dxvk_device.h" diff --git a/src/dxvk/meson.build b/src/dxvk/meson.build index cfef8847a..8b04f41ac 100644 --- a/src/dxvk/meson.build +++ b/src/dxvk/meson.build @@ -367,6 +367,10 @@ dxvk_src = files([ 'imgui/implot_items.cpp', ]) +dxvk_pch = [ + 'pch/dxvk_pch.h', +] + thread_dep = dependency('threads') nrd_include_dir = include_directories(join_paths('../../', 'external/nrd/Include')) @@ -434,7 +438,8 @@ dxvk_lib = static_library('dxvk', dxvk_src, dxvk_version, [generated_dxvk_shader link_with : [ util_lib, spirv_lib ], dependencies : [ dxvk_deps ], include_directories : [ dxvk_include_path, dxvk_shader_include_path, rtxdi_include_path, remix_api_include_path ], - override_options : ['cpp_std='+dxvk_cpp_std]) + override_options : ['cpp_std='+dxvk_cpp_std], + cpp_pch : dxvk_pch) dxvk_dep = declare_dependency( link_with : [ dxvk_lib ], diff --git a/src/dxvk/pch/dxvk_pch.h b/src/dxvk/pch/dxvk_pch.h new file mode 100644 index 000000000..a3c569fbd --- /dev/null +++ b/src/dxvk/pch/dxvk_pch.h @@ -0,0 +1 @@ +#include "dxvk_device.h" diff --git a/src/dxvk/rtx_render/rtx_ngx_wrapper.cpp b/src/dxvk/rtx_render/rtx_ngx_wrapper.cpp index 14ed21ab0..96db9bed0 100644 --- a/src/dxvk/rtx_render/rtx_ngx_wrapper.cpp +++ b/src/dxvk/rtx_render/rtx_ngx_wrapper.cpp @@ -20,10 +20,12 @@ * DEALINGS IN THE SOFTWARE. */ +#ifndef _WIN32_WINNT #define WIN32_NO_STATUS #include #undef WIN32_NO_STATUS #include +#endif #include #include #include