mirror of
https://github.com/libretro/parallel-gx1.git
synced 2026-11-07 04:26:01 -10:00
libretro: fail the load when the hardware renderer gets no hardware context
This commit is contained in:
1 parent
b93001ed50
commit
66e9ab0f50
1 file changed
+8
@@ -679,6 +679,14 @@ bool retro_load_game(const struct retro_game_info* game)
|
||||
Libretro::FrameTiming::Init();
|
||||
Libretro::Audio::Init();
|
||||
Libretro::Video::Init();
|
||||
// The hardware renderer was asked for and no hardware context was granted (e.g. no GLES 3): fail the load so the
|
||||
// frontend reports it, rather than run on the null backend behind a black screen.
|
||||
if (Libretro::Options::GetCached<std::string>(Libretro::Options::gfx_settings::RENDERER) == "Hardware" &&
|
||||
Libretro::Video::hw_render.context_type == RETRO_HW_CONTEXT_NONE)
|
||||
{
|
||||
ERROR_LOG_FMT(VIDEO, "No hardware render context was granted; refusing to load");
|
||||
return false;
|
||||
}
|
||||
WindowSystemInfo wsi(WindowSystemType::Libretro, nullptr, nullptr, nullptr);
|
||||
VideoBackendBase::PopulateBackendInfo(wsi);
|
||||
NOTICE_LOG_FMT(VIDEO, "Using GFX backend: {}", Config::Get(Config::MAIN_GFX_BACKEND));
|
||||
|
||||
Reference in new issue
Block a user