@ -57,7 +57,7 @@ bool CheckEnvVars(bool* is_child) {
return false ;
}
bool StartupChecks ( const char * arg0 , bool * has_broken_vulkan ) {
bool StartupChecks ( const char * arg0 , bool * has_broken_vulkan , bool perform_vulkan_check ) {
# ifdef _WIN32
// Set the startup variable for child processes
const bool env_var_set = SetEnvironmentVariableA ( STARTUP_CHECK_ENV_VAR , ENV_VAR_ENABLED_TEXT ) ;
@ -67,6 +67,8 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan) {
return false ;
}
if ( perform_vulkan_check ) {
// Spawn child process that performs Vulkan check
PROCESS_INFORMATION process_info ;
std : : memset ( & process_info , ' \0 ' , sizeof ( process_info ) ) ;
@ -91,6 +93,7 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan) {
if ( CloseHandle ( process_info . hThread ) = = 0 ) {
std : : fprintf ( stderr , " CloseHandle failed with error %d \n " , GetLastError ( ) ) ;
}
}
if ( ! SetEnvironmentVariableA ( STARTUP_CHECK_ENV_VAR , nullptr ) ) {
std : : fprintf ( stderr , " SetEnvironmentVariableA failed to clear %s with error %d \n " ,
@ -98,6 +101,7 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan) {
}
# elif defined(YUZU_UNIX)
if ( perform_vulkan_check ) {
const pid_t pid = fork ( ) ;
if ( pid = = 0 ) {
CheckVulkan ( ) ;
@ -118,6 +122,7 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan) {
}
// Vulkan is broken if the child crashed (return value is not zero)
* has_broken_vulkan = ( status ! = 0 ) ;
}
# endif
return false ;
}