summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-10-06 15:31:12 +0200
committerLiam <byteslice@airmail.cc>2022-10-07 23:33:59 +0200
commita5476541f2adf5a61820033e5f2d77ab5ab4d5fc (patch)
tree18150114340decce507d23650b0efd002ea39789 /src/video_core
parentMerge pull request #6142 from lat9nq/prog_meta_ref_bind_address (diff)
downloadyuzu-a5476541f2adf5a61820033e5f2d77ab5ab4d5fc.tar
yuzu-a5476541f2adf5a61820033e5f2d77ab5ab4d5fc.tar.gz
yuzu-a5476541f2adf5a61820033e5f2d77ab5ab4d5fc.tar.bz2
yuzu-a5476541f2adf5a61820033e5f2d77ab5ab4d5fc.tar.lz
yuzu-a5476541f2adf5a61820033e5f2d77ab5ab4d5fc.tar.xz
yuzu-a5476541f2adf5a61820033e5f2d77ab5ab4d5fc.tar.zst
yuzu-a5476541f2adf5a61820033e5f2d77ab5ab4d5fc.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_base.cpp8
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;
}