Skip to content

Commit

Permalink
Vulkan: substitute \vid_restart fast -> keep_window for now, REF_KEEP…
Browse files Browse the repository at this point in the history
…_CONTEXT should be used only between normal/level restarts
  • Loading branch information
ec- committed Oct 29, 2023
1 parent ccd7ab4 commit 914fc40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions code/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1841,15 +1841,12 @@ Wrapper for CL_Vid_Restart
*/
static void CL_Vid_Restart_f( void ) {

if ( Q_stricmp( Cmd_Argv(1), "keep_window" ) == 0 ) {
if ( Q_stricmp( Cmd_Argv( 1 ), "keep_window" ) == 0 || Q_stricmp( Cmd_Argv( 1 ), "fast" ) == 0 ) {
// fast path: keep window
CL_Vid_Restart( REF_KEEP_WINDOW );
} else if ( Q_stricmp(Cmd_Argv(1), "fast") == 0 ) {
// fast path: keep context
CL_Vid_Restart( REF_KEEP_CONTEXT );
} else {
if ( cls.lastVidRestart ) {
if ( abs( cls.lastVidRestart - Sys_Milliseconds()) < 500 ) {
if ( abs( cls.lastVidRestart - Sys_Milliseconds() ) < 500 ) {
// hack for OSP mod: do not allow vid restart right after cgame init
return;
}
Expand Down
4 changes: 2 additions & 2 deletions code/renderervk/tr_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,13 +1965,13 @@ static void RE_Shutdown( refShutdownCode_t code ) {
if ( r_device->modified ) {
code = REF_UNLOAD_DLL;
}

vk_shutdown( code );
#endif

// shut down platform specific OpenGL/Vulkan stuff
if ( code != REF_KEEP_CONTEXT ) {
#ifdef USE_VULKAN
vk_shutdown( code );

Com_Memset( &glState, 0, sizeof( glState ) );

if ( code != REF_KEEP_WINDOW ) {
Expand Down

0 comments on commit 914fc40

Please sign in to comment.