diff options
author | bunnei <bunneidev@gmail.com> | 2019-01-08 05:16:01 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2019-01-24 01:19:23 +0100 |
commit | 045b0b70b67b7bc631c69625e6e67a8e8a5c3a58 (patch) | |
tree | 872f5d8013e2e0fd3a2f6ecff86b4ad64fbf573d /src/video_core/renderer_opengl | |
parent | Merge pull request #2047 from FearlessTobi/patch-3 (diff) | |
download | yuzu-045b0b70b67b7bc631c69625e6e67a8e8a5c3a58.tar yuzu-045b0b70b67b7bc631c69625e6e67a8e8a5c3a58.tar.gz yuzu-045b0b70b67b7bc631c69625e6e67a8e8a5c3a58.tar.bz2 yuzu-045b0b70b67b7bc631c69625e6e67a8e8a5c3a58.tar.lz yuzu-045b0b70b67b7bc631c69625e6e67a8e8a5c3a58.tar.xz yuzu-045b0b70b67b7bc631c69625e6e67a8e8a5c3a58.tar.zst yuzu-045b0b70b67b7bc631c69625e6e67a8e8a5c3a58.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 4 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 16 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 10 |
3 files changed, 2 insertions, 28 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index d8e9df5db..6600ad528 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -643,8 +643,6 @@ void RasterizerOpenGL::Clear() { return; } - ScopeAcquireGLContext acquire_context{emu_window}; - ConfigureFramebuffers(clear_state, use_color, use_depth || use_stencil, false, regs.clear_buffers.RT.Value()); if (regs.clear_flags.scissor) { @@ -678,8 +676,6 @@ void RasterizerOpenGL::DrawArrays() { auto& gpu = Core::System::GetInstance().GPU().Maxwell3D(); const auto& regs = gpu.regs; - ScopeAcquireGLContext acquire_context{emu_window}; - ConfigureFramebuffers(state); SyncColorMask(); SyncFragmentColorClampState(); diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index c268c9686..e37b65b38 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -14,6 +14,7 @@ #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" +#include "core/frontend/scope_acquire_window_context.h" #include "core/memory.h" #include "core/perf_stats.h" #include "core/settings.h" @@ -97,18 +98,6 @@ static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, cons return matrix; } -ScopeAcquireGLContext::ScopeAcquireGLContext(Core::Frontend::EmuWindow& emu_window_) - : emu_window{emu_window_} { - if (Settings::values.use_multi_core) { - emu_window.MakeCurrent(); - } -} -ScopeAcquireGLContext::~ScopeAcquireGLContext() { - if (Settings::values.use_multi_core) { - emu_window.DoneCurrent(); - } -} - RendererOpenGL::RendererOpenGL(Core::Frontend::EmuWindow& window) : VideoCore::RendererBase{window} {} @@ -117,7 +106,6 @@ RendererOpenGL::~RendererOpenGL() = default; /// Swap buffers (render frame) void RendererOpenGL::SwapBuffers( std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer) { - ScopeAcquireGLContext acquire_context{render_window}; Core::System::GetInstance().GetPerfStats().EndSystemFrame(); @@ -506,7 +494,7 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum /// Initialize the renderer bool RendererOpenGL::Init() { - ScopeAcquireGLContext acquire_context{render_window}; + Core::Frontend::ScopeAcquireWindowContext acquire_context{render_window}; if (GLAD_GL_KHR_debug) { glEnable(GL_DEBUG_OUTPUT); diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index b85cc262f..1665018db 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -39,16 +39,6 @@ struct ScreenInfo { TextureInfo texture; }; -/// Helper class to acquire/release OpenGL context within a given scope -class ScopeAcquireGLContext : NonCopyable { -public: - explicit ScopeAcquireGLContext(Core::Frontend::EmuWindow& window); - ~ScopeAcquireGLContext(); - -private: - Core::Frontend::EmuWindow& emu_window; -}; - class RendererOpenGL : public VideoCore::RendererBase { public: explicit RendererOpenGL(Core::Frontend::EmuWindow& window); |