mirror of
https://github.com/azahar-emu/azahar
synced 2025-11-06 23:19:57 +01:00
* renderer_vulkan: remove out of context SDL_Quit call (fixes #1220) SDL_Quit must not be called unless the application must exit or SDL is no longer needed * comment: simplify, forgot init had ref-count
This commit is contained in:
parent
687c4415be
commit
fcdfe03674
@ -61,22 +61,23 @@ constexpr static std::array<vk::DescriptorSetLayoutBinding, 1> PRESENT_BINDINGS
|
|||||||
namespace {
|
namespace {
|
||||||
static bool IsLowRefreshRate() {
|
static bool IsLowRefreshRate() {
|
||||||
#ifdef ENABLE_SDL2
|
#ifdef ENABLE_SDL2
|
||||||
const auto sdl_init_status = SDL_Init(SDL_INIT_VIDEO);
|
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
|
||||||
if (sdl_init_status < 0) {
|
LOG_ERROR(Render_Vulkan, "SDL video failed to initialize, unable to check refresh rate");
|
||||||
LOG_ERROR(Render_Vulkan, "SDL failed to initialize, unable to check refresh rate");
|
return false;
|
||||||
} else {
|
}
|
||||||
SDL_DisplayMode cur_display_mode;
|
|
||||||
SDL_GetCurrentDisplayMode(0, &cur_display_mode); // TODO: Multimonitor handling. -OS
|
|
||||||
const auto cur_refresh_rate = cur_display_mode.refresh_rate;
|
|
||||||
SDL_Quit();
|
|
||||||
|
|
||||||
if (cur_refresh_rate < SCREEN_REFRESH_RATE) {
|
SDL_DisplayMode cur_display_mode;
|
||||||
LOG_WARNING(Render_Vulkan,
|
SDL_GetCurrentDisplayMode(0, &cur_display_mode); // TODO: Multimonitor handling. -OS
|
||||||
"Detected refresh rate lower than the emulated 3DS screen: {}hz. FIFO will "
|
const auto cur_refresh_rate = cur_display_mode.refresh_rate;
|
||||||
"be disabled",
|
|
||||||
cur_refresh_rate);
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
return true;
|
|
||||||
}
|
if (cur_refresh_rate < SCREEN_REFRESH_RATE) {
|
||||||
|
LOG_WARNING(Render_Vulkan,
|
||||||
|
"Detected refresh rate lower than the emulated 3DS screen: {}hz. FIFO will "
|
||||||
|
"be disabled",
|
||||||
|
cur_refresh_rate);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user