Frontend PR fixes (#6378)

* citra_qt: Check if renderer is null

* core: Fix dynarmic use-after-free error

* bootmanager: Add current context check in DoneCurrent

* Loading a save state would destroy the frame dumper class, which contains a shared context. That context would call DoneCurrent without checking if it was actually bound or not, resulting in crashes when calling opengl functions

* externals: Correct glad readme

* common: Log renderer debug setting

* citra: Make lambda lower case

* Consistency with review comments on the PR

* video_core: Kill more global state

* GetResolutionScaleFactor would be called somewhere in the renderer constructor chain but it relies on the yet unitialized g_renderer, resulting in crashes when the resolution scale is set to auto. Rather than adding a workaround, let's kill this global state to fix this for good
This commit is contained in:
GPUCode 2023-03-30 14:24:49 +03:00 committed by GitHub
parent 5346ca27b5
commit ffc95eb59b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 102 additions and 93 deletions

View file

@ -364,8 +364,8 @@ int main(int argc, char** argv) {
EmuWindow_SDL2::InitializeSDL2();
const auto CreateEmuWindow = [](bool fullscreen,
bool is_secondary) -> std::unique_ptr<EmuWindow_SDL2> {
const auto create_emu_window = [](bool fullscreen,
bool is_secondary) -> std::unique_ptr<EmuWindow_SDL2> {
switch (Settings::values.graphics_api.GetValue()) {
case Settings::GraphicsAPI::OpenGL:
return std::make_unique<EmuWindow_SDL2_GL>(fullscreen, is_secondary);
@ -374,11 +374,11 @@ int main(int argc, char** argv) {
}
};
const auto emu_window{CreateEmuWindow(fullscreen, false)};
const auto emu_window{create_emu_window(fullscreen, false)};
const bool use_secondary_window{
Settings::values.layout_option.GetValue() == Settings::LayoutOption::SeparateWindows &&
Settings::values.graphics_api.GetValue() != Settings::GraphicsAPI::Software};
const auto secondary_window = use_secondary_window ? CreateEmuWindow(false, true) : nullptr;
const auto secondary_window = use_secondary_window ? create_emu_window(false, true) : nullptr;
const auto scope = emu_window->Acquire();
@ -448,8 +448,8 @@ int main(int argc, char** argv) {
Core::Movie::GetInstance().StartRecording(movie_record, movie_record_author);
}
if (!dump_video.empty()) {
Layout::FramebufferLayout layout{
Layout::FrameLayoutFromResolutionScale(VideoCore::GetResolutionScaleFactor())};
Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(
VideoCore::g_renderer->GetResolutionScaleFactor())};
system.VideoDumper().StartDumping(dump_video, layout);
}