rtx: add command to reload rad files, fix #41

vk_rtx_reload_rad
This commit is contained in:
Ivan 'provod' Avdeev 2021-09-14 10:24:27 -07:00 committed by Ivan Avdeev
parent afa1e8557a
commit fbd8973a6d
3 changed files with 20 additions and 0 deletions

View File

@ -414,6 +414,13 @@ void VK_LightsNewMap( void )
g_lights.map.grid_cells
);
VK_LightsLoadMapStaticLights();
}
void VK_LightsLoadMapStaticLights( void )
{
const model_t *map = gEngine.pfnGetModelByIndex( 1 );
parseStaticLightEntities();
// Load RAD data based on map name

View File

@ -45,6 +45,7 @@ extern vk_lights_t g_lights;
void VK_LightsShutdown( void );
void VK_LightsNewMap( void );
void VK_LightsLoadMapStaticLights( void );
void VK_LightsFrameInit( void );

View File

@ -132,6 +132,7 @@ static struct {
vk_image_t frames[2];
qboolean reload_pipeline;
qboolean reload_lighting;
} g_rtx = {0};
VkDeviceAddress getBufferDeviceAddress(VkBuffer buffer) {
@ -320,6 +321,11 @@ void VK_RayFrameBegin( void )
XVK_RayModel_ClearForNextFrame();
if (g_rtx.reload_lighting) {
g_rtx.reload_lighting = false;
VK_LightsLoadMapStaticLights();
}
// TODO shouldn't we do this in freeze models mode anyway?
VK_LightsFrameInit();
}
@ -944,6 +950,11 @@ static void reloadPipeline( void ) {
g_rtx.reload_pipeline = true;
}
static void reloadLighting( void ) {
g_rtx.reload_lighting = true;
}
static void freezeModels( void ) {
g_ray_model_state.freeze_models = !g_ray_model_state.freeze_models;
}
@ -1043,6 +1054,7 @@ qboolean VK_RayInit( void )
if (vk_core.debug) {
gEngine.Cmd_AddCommand("vk_rtx_reload", reloadPipeline, "Reload RTX shader");
gEngine.Cmd_AddCommand("vk_rtx_reload_rad", reloadLighting, "Reload RAD files for static lights");
gEngine.Cmd_AddCommand("vk_rtx_freeze", freezeModels, "Freeze models, do not update/add/delete models from to-draw list");
}