diff options
author | bunnei <bunneidev@gmail.com> | 2022-10-12 22:26:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 22:26:32 +0200 |
commit | e15816713964fe924e4edd646a75d976165e37de (patch) | |
tree | 6fff31d5aaf9ebcebda2eadc0c5acdab68a5cdad /src/video_core/renderer_base.cpp | |
parent | Merge pull request #9047 from german77/steam-aspect (diff) | |
parent | video_core: don't block rendering on screenshots (diff) | |
download | yuzu-e15816713964fe924e4edd646a75d976165e37de.tar yuzu-e15816713964fe924e4edd646a75d976165e37de.tar.gz yuzu-e15816713964fe924e4edd646a75d976165e37de.tar.bz2 yuzu-e15816713964fe924e4edd646a75d976165e37de.tar.lz yuzu-e15816713964fe924e4edd646a75d976165e37de.tar.xz yuzu-e15816713964fe924e4edd646a75d976165e37de.tar.zst yuzu-e15816713964fe924e4edd646a75d976165e37de.zip |
Diffstat (limited to 'src/video_core/renderer_base.cpp')
-rw-r--r-- | src/video_core/renderer_base.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index 45791aa75..e8761a747 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2015 Citra Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include <thread> + #include "common/logging/log.h" #include "core/frontend/emu_window.h" #include "video_core/renderer_base.h" @@ -35,8 +37,12 @@ void RendererBase::RequestScreenshot(void* data, std::function<void(bool)> callb LOG_ERROR(Render, "A screenshot is already requested or in progress, ignoring the request"); return; } + auto async_callback{[callback = std::move(callback)](bool invert_y) { + std::thread t{callback, invert_y}; + t.detach(); + }}; renderer_settings.screenshot_bits = data; - renderer_settings.screenshot_complete_callback = std::move(callback); + renderer_settings.screenshot_complete_callback = async_callback; renderer_settings.screenshot_framebuffer_layout = layout; renderer_settings.screenshot_requested = true; } |