From 8ac44895e104fa3350cebd93e00d3961af28216b Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Wed, 15 Feb 2023 23:00:50 -0500 Subject: [PATCH] Fix PCH build failures (on linux) when USE_VMA allocator option enabled --- neo/CMakeLists.txt | 6 ++++++ neo/renderer/BufferObject.h | 1 + neo/renderer/Image.h | 4 ---- neo/sys/DeviceManager_VK.cpp | 3 +++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 7728ce78..6d8aee37 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -1603,6 +1603,9 @@ if(MSVC) list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/prelightshadowvolume/PreLightShadowVolume.cpp) list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/staticshadowvolume/StaticShadowVolume.cpp) list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/ShadowShared.cpp) + if(USE_VULKAN AND USE_VMA) + list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sys/DeviceManager_VK.cpp) + endif() #foreach( src_file ${RBDOOM3_PRECOMPILED_SOURCES} ) # message(STATUS "-include precompiled.h for ${src_file}") @@ -1754,6 +1757,9 @@ else() list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/prelightshadowvolume/PreLightShadowVolume.cpp) list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/staticshadowvolume/StaticShadowVolume.cpp) list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/ShadowShared.cpp) + if(USE_VULKAN AND USE_VMA) + list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sys/DeviceManager_VK.cpp) + endif() foreach( src_file ${RBDOOM3_PRECOMPILED_SOURCES} ) #message(STATUS "-include precompiled.h for ${src_file}") diff --git a/neo/renderer/BufferObject.h b/neo/renderer/BufferObject.h index 4f4458ab..864a3cea 100644 --- a/neo/renderer/BufferObject.h +++ b/neo/renderer/BufferObject.h @@ -38,6 +38,7 @@ If you have questions concerning this license or the applicable additional terms #include #if defined( USE_AMD_ALLOCATOR ) + #include #include "vk_mem_alloc.h" #endif #endif diff --git a/neo/renderer/Image.h b/neo/renderer/Image.h index 3224a8a0..7e1a1e1a 100644 --- a/neo/renderer/Image.h +++ b/neo/renderer/Image.h @@ -288,10 +288,6 @@ typedef void ( *ImageGeneratorFunction )( idImage* image, nvrhi::ICommandList* c #include "BinaryImage.h" -#if defined( USE_AMD_ALLOCATOR ) -#include "vk_mem_alloc.h" -#endif - #define MAX_IMAGE_NAME 256 class idImage diff --git a/neo/sys/DeviceManager_VK.cpp b/neo/sys/DeviceManager_VK.cpp index f6162b33..df9ea554 100644 --- a/neo/sys/DeviceManager_VK.cpp +++ b/neo/sys/DeviceManager_VK.cpp @@ -20,8 +20,11 @@ * DEALINGS IN THE SOFTWARE. */ +// SRS - Disable PCH for USE_AMD_ALLOCATOR option, otherwise get Vulkan header mismatch failures +#if !defined( USE_AMD_ALLOCATOR ) #include #pragma hdrstop +#endif #include #include