Build-time perf improvement for PCH, c_str() fix in idCameraAnim::gltfLoadAnim()

This commit is contained in:
Stephen Saunders 2022-12-24 14:10:55 -05:00
parent 21947e8f08
commit e7b681a06e
14 changed files with 43 additions and 48 deletions

View file

@ -1131,7 +1131,7 @@ source_group("renderer\\jobs\\staticshadowvolume" FILES ${RENDERER_JOBS_STATICSH
source_group("renderer\\OpenGL" FILES ${RENDERER_OPENGL_INCLUDES})
source_group("renderer\\OpenGL" FILES ${RENDERER_OPENGL_SOURCES})
source_group("renderer\\NVRHI" FILES ${RENDERER_NVRHI_INCLUES})
source_group("renderer\\NVRHI" FILES ${RENDERER_NVRHI_INCLUDES})
source_group("renderer\\NVRHI" FILES ${RENDERER_NVRHI_SOURCES})
source_group("renderer\\Vulkan" FILES ${RENDERER_VULKAN_INCLUDES})
@ -1583,10 +1583,6 @@ 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)
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/RenderLog.cpp)
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/Vulkan/vma.cpp)
#list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES d3xp/gamesys/Class.cpp)
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/framework/precompiled.cpp)
#foreach( src_file ${RBDOOM3_PRECOMPILED_SOURCES} )
# message(STATUS "-include precompiled.h for ${src_file}")
@ -1738,7 +1734,6 @@ 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)
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/RenderLog.cpp)
foreach( src_file ${RBDOOM3_PRECOMPILED_SOURCES} )
#message(STATUS "-include precompiled.h for ${src_file}")

View file

@ -771,7 +771,7 @@ void idCameraAnim::gltfLoadAnim( idStr gltfFileName, idStr animName )
if( anim == nullptr )
{
gameLocal.Error( "Missing 'anim.%s' on '%s'", animName, gltfFileName.c_str() );
gameLocal.Error( "Missing 'anim.%s' on '%s'", animName.c_str(), gltfFileName.c_str() );
}
cameraCuts.Clear();

View file

@ -99,7 +99,7 @@ const int MAX_EXPRESSION_REGISTERS = 4096;
#if defined( USE_NVRHI )
#include "nvrhi/nvrhi.h"
#elif defined(USE_VULKAN)
#elif defined( USE_VULKAN )
#include "../renderer/Vulkan/qvk.h"
#else
#include <GL/glew.h>
@ -114,6 +114,7 @@ const int MAX_EXPRESSION_REGISTERS = 4096;
#include "../renderer/RenderSystem.h"
#include "../renderer/RenderWorld.h"
#include "../renderer/BindingCache.h"
#include "../renderer/RenderCommon.h"
// sound engine
#include "../sound/sound.h"

View file

@ -43,10 +43,11 @@ struct guiModelSurface_t
class idRenderMatrix;
class Framebuffer;
namespace ImGui
{
struct ImDrawData;
}
// SRS - not needed, causes mismatched types when calling ImGui_RenderDrawLists( ImDrawData* )
//namespace ImGui
//{
//struct ImDrawData;
//}
struct ImDrawData;

View file

@ -127,7 +127,7 @@ void RB_SetVertexColorParms( stageVertexColor_t svc );
#if defined( USE_VULKAN )
// SRS - Generalized Vulkan SDL platform
#if defined(VULKAN_USE_PLATFORM_SDL)
#if defined( VULKAN_USE_PLATFORM_SDL )
#include <SDL.h>
#include <SDL_vulkan.h>
#endif
@ -148,7 +148,7 @@ struct vulkanContext_t
{
// Eric: If on linux, use this to pass SDL_Window pointer to the SDL_Vulkan_* methods not in sdl_vkimp.cpp file.
// SRS - Generalized Vulkan SDL platform
#if defined(VULKAN_USE_PLATFORM_SDL)
#if defined( VULKAN_USE_PLATFORM_SDL )
SDL_Window* sdlWindow = nullptr;
#endif
uint64 frameCounter;

View file

@ -40,27 +40,6 @@ If you have questions concerning this license or the applicable additional terms
#include "Font.h"
#include "Framebuffer.h"
#if defined( USE_NVRHI )
#if USE_DX11 || USE_DX12
#include <DXGI.h>
#endif
#if USE_DX11
#include <d3d11.h>
#endif
#if USE_DX12
#include <d3d12.h>
#endif
#if USE_VK
#include <nvrhi/vulkan.h>
#endif
#include <nvrhi/nvrhi.h>
#endif
// maximum texture units
const int MAX_PROG_TEXTURE_PARMS = 16;
@ -1415,15 +1394,14 @@ struct glimpParms_t
// Eric: If on Linux using Vulkan use the sdl_vkimp.cpp methods
// SRS - Generalized Vulkan SDL platform
#if defined(VULKAN_USE_PLATFORM_SDL)
#if defined( VULKAN_USE_PLATFORM_SDL )
#include <vector>
#define CLAMP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
// Helper functions for using SDL2 and Vulkan on Linux.
// Helper function for using SDL2 and Vulkan on Linux.
std::vector<const char*> get_required_extensions();
#if defined( USE_NVRHI )
vk::Result CreateSDLWindowSurface( vk::Instance instance, vk::SurfaceKHR* surface );
#else
#if !defined( USE_NVRHI )
extern vulkanContext_t vkcontext;
#endif

View file

@ -26,7 +26,7 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
#include "RenderCommon.h"
#include "precompiled.h"
#pragma hdrstop
#if defined( USE_NVRHI )

View file

@ -1516,7 +1516,7 @@ void R_SetColorMappings()
tr.gammaTable[i] = idMath::ClampInt( 0, 0xFFFF, inf );
}
// SRS - Generalized Vulkan SDL platform
#if defined(VULKAN_USE_PLATFORM_SDL)
#if defined( VULKAN_USE_PLATFORM_SDL )
VKimp_SetGamma( tr.gammaTable, tr.gammaTable, tr.gammaTable );
#else
GLimp_SetGamma( tr.gammaTable, tr.gammaTable, tr.gammaTable );

View file

@ -30,7 +30,21 @@ If you have questions concerning this license or the applicable additional terms
#ifndef SYS_DEVICE_MANAGER_H_
#define SYS_DEVICE_MANAGER_H_
#include "renderer/RenderCommon.h"
#if USE_DX11 || USE_DX12
#include <DXGI.h>
#endif
#if USE_DX11
#include <d3d11.h>
#endif
#if USE_DX12
#include <d3d12.h>
#endif
#if USE_VK
#include <nvrhi/vulkan.h>
#endif
struct DeviceCreationParameters
{
@ -118,6 +132,11 @@ class DeviceManager
public:
static DeviceManager* Create( nvrhi::GraphicsAPI api );
#if defined( USE_VK ) && defined( VULKAN_USE_PLATFORM_SDL )
// SRS - Helper method for creating SDL Vulkan surface within DeviceManager_VK()
vk::Result CreateSDLWindowSurface( vk::Instance instance, vk::SurfaceKHR* surface );
#endif
bool CreateWindowDeviceAndSwapChain( const glimpParms_t& params, const char* windowTitle );
// returns the size of the window in screen coordinates

View file

@ -27,6 +27,7 @@
#include <queue>
#include <unordered_set>
#include "renderer/RenderCommon.h"
#include <sys/DeviceManager.h>
#include <nvrhi/vulkan.h>

View file

@ -853,7 +853,7 @@ void Sys_GrabMouseCursor( bool grabIt )
flags = GRAB_SETSTATE;
}
// SRS - Generalized Vulkan SDL platform
#if defined(VULKAN_USE_PLATFORM_SDL)
#if defined( VULKAN_USE_PLATFORM_SDL )
VKimp_GrabInput( flags );
#else
GLimp_GrabInput( flags );

View file

@ -36,7 +36,7 @@ const int GRAB_HIDECURSOR = ( 1 << 2 );
const int GRAB_SETSTATE = ( 1 << 3 );
// SRS - Generalized Vulkan SDL platform
#if defined(VULKAN_USE_PLATFORM_SDL)
#if defined( VULKAN_USE_PLATFORM_SDL )
void VKimp_GrabInput( int flags );
#else
void GLimp_GrabInput( int flags );

View file

@ -89,8 +89,8 @@ std::vector<const char*> get_required_extensions()
}
#if defined( USE_NVRHI )
// SRS - Helper function for creating SDL Vulkan surface within DeviceManager_VK() when NVRHI enabled
vk::Result CreateSDLWindowSurface( vk::Instance instance, vk::SurfaceKHR* surface )
// SRS - Helper method for creating SDL Vulkan surface within DeviceManager_VK() when NVRHI enabled
vk::Result DeviceManager::CreateSDLWindowSurface( vk::Instance instance, vk::SurfaceKHR* surface )
{
if( !SDL_Vulkan_CreateSurface( window, ( VkInstance )instance, ( VkSurfaceKHR* )surface ) )
{

View file

@ -32,7 +32,7 @@ If you have questions concerning this license or the applicable additional terms
#include "DeviceContext.h"
#include "libs/imgui/imgui.h"
#include "../renderer/GuiModel.h"
#include "../renderer/RenderCommon.h"
extern idCVar in_useJoystick;