mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 13:25:45 +00:00
frontend: qt: bootmanager: Acquire a shared context in main emu thread.
This commit is contained in:
parent
ba6d264342
commit
0f0268bdd9
2 changed files with 12 additions and 12 deletions
|
@ -39,7 +39,10 @@
|
|||
#include "yuzu/bootmanager.h"
|
||||
#include "yuzu/main.h"
|
||||
|
||||
EmuThread::EmuThread(Core::Frontend::GraphicsContext& core_context) : core_context(core_context) {}
|
||||
EmuThread::EmuThread(GRenderWindow& window)
|
||||
: shared_context{window.CreateSharedContext()},
|
||||
context{(Settings::values.use_asynchronous_gpu_emulation && shared_context) ? *shared_context
|
||||
: window} {}
|
||||
|
||||
EmuThread::~EmuThread() = default;
|
||||
|
||||
|
@ -55,15 +58,7 @@ static GMainWindow* GetMainWindow() {
|
|||
void EmuThread::run() {
|
||||
MicroProfileOnThreadCreate("EmuThread");
|
||||
|
||||
// Acquire render context for duration of the thread if this is the rendering thread
|
||||
if (!Settings::values.use_asynchronous_gpu_emulation) {
|
||||
core_context.MakeCurrent();
|
||||
}
|
||||
SCOPE_EXIT({
|
||||
if (!Settings::values.use_asynchronous_gpu_emulation) {
|
||||
core_context.DoneCurrent();
|
||||
}
|
||||
});
|
||||
Core::Frontend::ScopeAcquireContext acquire_context{context};
|
||||
|
||||
emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue