summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/core.cpp3
-rw-r--r--src/core/frontend/emu_window.h3
-rw-r--r--src/core/frontend/framebuffer_layout.h1
-rw-r--r--src/core/frontend/scope_acquire_context.cpp18
-rw-r--r--src/core/frontend/scope_acquire_context.h (renamed from src/core/frontend/scope_acquire_window_context.h)10
-rw-r--r--src/core/frontend/scope_acquire_window_context.cpp18
-rw-r--r--src/core/settings.cpp1
-rw-r--r--src/core/settings.h1
-rw-r--r--src/core/telemetry_session.cpp1
10 files changed, 32 insertions, 28 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 88c06b2ce..54be7dc0c 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -131,8 +131,8 @@ add_library(core STATIC
131 frontend/framebuffer_layout.cpp 131 frontend/framebuffer_layout.cpp
132 frontend/framebuffer_layout.h 132 frontend/framebuffer_layout.h
133 frontend/input.h 133 frontend/input.h
134 frontend/scope_acquire_window_context.cpp 134 frontend/scope_acquire_context.cpp
135 frontend/scope_acquire_window_context.h 135 frontend/scope_acquire_context.h
136 gdbstub/gdbstub.cpp 136 gdbstub/gdbstub.cpp
137 gdbstub/gdbstub.h 137 gdbstub/gdbstub.h
138 hardware_interrupt_manager.cpp 138 hardware_interrupt_manager.cpp
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 86e314c94..a82faf127 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -24,6 +24,7 @@
24#include "core/file_sys/sdmc_factory.h" 24#include "core/file_sys/sdmc_factory.h"
25#include "core/file_sys/vfs_concat.h" 25#include "core/file_sys/vfs_concat.h"
26#include "core/file_sys/vfs_real.h" 26#include "core/file_sys/vfs_real.h"
27#include "core/frontend/scope_acquire_context.h"
27#include "core/gdbstub/gdbstub.h" 28#include "core/gdbstub/gdbstub.h"
28#include "core/hardware_interrupt_manager.h" 29#include "core/hardware_interrupt_manager.h"
29#include "core/hle/kernel/client_port.h" 30#include "core/hle/kernel/client_port.h"
@@ -184,6 +185,8 @@ struct System::Impl {
184 185
185 ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, 186 ResultStatus Load(System& system, Frontend::EmuWindow& emu_window,
186 const std::string& filepath) { 187 const std::string& filepath) {
188 Core::Frontend::ScopeAcquireContext acquire_context{emu_window};
189
187 app_loader = Loader::GetLoader(GetGameFileFromPath(virtual_filesystem, filepath)); 190 app_loader = Loader::GetLoader(GetGameFileFromPath(virtual_filesystem, filepath));
188 if (!app_loader) { 191 if (!app_loader) {
189 LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); 192 LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath);
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h
index 3376eedc5..5eb87fb63 100644
--- a/src/core/frontend/emu_window.h
+++ b/src/core/frontend/emu_window.h
@@ -26,9 +26,6 @@ public:
26 26
27 /// Releases (dunno if this is the "right" word) the context from the caller thread 27 /// Releases (dunno if this is the "right" word) the context from the caller thread
28 virtual void DoneCurrent() = 0; 28 virtual void DoneCurrent() = 0;
29
30 /// Swap buffers to display the next frame
31 virtual void SwapBuffers() = 0;
32}; 29};
33 30
34/** 31/**
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h
index 1d39c1faf..e9d0a40d3 100644
--- a/src/core/frontend/framebuffer_layout.h
+++ b/src/core/frontend/framebuffer_layout.h
@@ -29,6 +29,7 @@ enum class AspectRatio {
29struct FramebufferLayout { 29struct FramebufferLayout {
30 u32 width{ScreenUndocked::Width}; 30 u32 width{ScreenUndocked::Width};
31 u32 height{ScreenUndocked::Height}; 31 u32 height{ScreenUndocked::Height};
32 bool is_srgb{};
32 33
33 Common::Rectangle<u32> screen; 34 Common::Rectangle<u32> screen;
34 35
diff --git a/src/core/frontend/scope_acquire_context.cpp b/src/core/frontend/scope_acquire_context.cpp
new file mode 100644
index 000000000..878c3157c
--- /dev/null
+++ b/src/core/frontend/scope_acquire_context.cpp
@@ -0,0 +1,18 @@
1// Copyright 2019 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/frontend/emu_window.h"
6#include "core/frontend/scope_acquire_context.h"
7
8namespace Core::Frontend {
9
10ScopeAcquireContext::ScopeAcquireContext(Core::Frontend::GraphicsContext& context)
11 : context{context} {
12 context.MakeCurrent();
13}
14ScopeAcquireContext::~ScopeAcquireContext() {
15 context.DoneCurrent();
16}
17
18} // namespace Core::Frontend
diff --git a/src/core/frontend/scope_acquire_window_context.h b/src/core/frontend/scope_acquire_context.h
index 2d9f6e825..7a65c0623 100644
--- a/src/core/frontend/scope_acquire_window_context.h
+++ b/src/core/frontend/scope_acquire_context.h
@@ -8,16 +8,16 @@
8 8
9namespace Core::Frontend { 9namespace Core::Frontend {
10 10
11class EmuWindow; 11class GraphicsContext;
12 12
13/// Helper class to acquire/release window context within a given scope 13/// Helper class to acquire/release window context within a given scope
14class ScopeAcquireWindowContext : NonCopyable { 14class ScopeAcquireContext : NonCopyable {
15public: 15public:
16 explicit ScopeAcquireWindowContext(Core::Frontend::EmuWindow& window); 16 explicit ScopeAcquireContext(Core::Frontend::GraphicsContext& context);
17 ~ScopeAcquireWindowContext(); 17 ~ScopeAcquireContext();
18 18
19private: 19private:
20 Core::Frontend::EmuWindow& emu_window; 20 Core::Frontend::GraphicsContext& context;
21}; 21};
22 22
23} // namespace Core::Frontend 23} // namespace Core::Frontend
diff --git a/src/core/frontend/scope_acquire_window_context.cpp b/src/core/frontend/scope_acquire_window_context.cpp
deleted file mode 100644
index 3663dad17..000000000
--- a/src/core/frontend/scope_acquire_window_context.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
1// Copyright 2019 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/frontend/emu_window.h"
6#include "core/frontend/scope_acquire_window_context.h"
7
8namespace Core::Frontend {
9
10ScopeAcquireWindowContext::ScopeAcquireWindowContext(Core::Frontend::EmuWindow& emu_window_)
11 : emu_window{emu_window_} {
12 emu_window.MakeCurrent();
13}
14ScopeAcquireWindowContext::~ScopeAcquireWindowContext() {
15 emu_window.DoneCurrent();
16}
17
18} // namespace Core::Frontend
diff --git a/src/core/settings.cpp b/src/core/settings.cpp
index d1fc94060..7c0303684 100644
--- a/src/core/settings.cpp
+++ b/src/core/settings.cpp
@@ -94,6 +94,7 @@ void LogSettings() {
94 LogSetting("Renderer_UseAccurateGpuEmulation", Settings::values.use_accurate_gpu_emulation); 94 LogSetting("Renderer_UseAccurateGpuEmulation", Settings::values.use_accurate_gpu_emulation);
95 LogSetting("Renderer_UseAsynchronousGpuEmulation", 95 LogSetting("Renderer_UseAsynchronousGpuEmulation",
96 Settings::values.use_asynchronous_gpu_emulation); 96 Settings::values.use_asynchronous_gpu_emulation);
97 LogSetting("Renderer_UseVsync", Settings::values.use_vsync);
97 LogSetting("Audio_OutputEngine", Settings::values.sink_id); 98 LogSetting("Audio_OutputEngine", Settings::values.sink_id);
98 LogSetting("Audio_EnableAudioStretching", Settings::values.enable_audio_stretching); 99 LogSetting("Audio_EnableAudioStretching", Settings::values.enable_audio_stretching);
99 LogSetting("Audio_OutputDevice", Settings::values.audio_device_id); 100 LogSetting("Audio_OutputDevice", Settings::values.audio_device_id);
diff --git a/src/core/settings.h b/src/core/settings.h
index f837d3fbc..15b691342 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -435,6 +435,7 @@ struct Values {
435 bool use_disk_shader_cache; 435 bool use_disk_shader_cache;
436 bool use_accurate_gpu_emulation; 436 bool use_accurate_gpu_emulation;
437 bool use_asynchronous_gpu_emulation; 437 bool use_asynchronous_gpu_emulation;
438 bool use_vsync;
438 bool force_30fps_mode; 439 bool force_30fps_mode;
439 440
440 float bg_red; 441 float bg_red;
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index 0e72d31cd..0f3685d1c 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -188,6 +188,7 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) {
188 Settings::values.use_accurate_gpu_emulation); 188 Settings::values.use_accurate_gpu_emulation);
189 AddField(field_type, "Renderer_UseAsynchronousGpuEmulation", 189 AddField(field_type, "Renderer_UseAsynchronousGpuEmulation",
190 Settings::values.use_asynchronous_gpu_emulation); 190 Settings::values.use_asynchronous_gpu_emulation);
191 AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync);
191 AddField(field_type, "System_UseDockedMode", Settings::values.use_docked_mode); 192 AddField(field_type, "System_UseDockedMode", Settings::values.use_docked_mode);
192} 193}
193 194