summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-21 01:22:43 +0200
committerLioncash <mathew1800@gmail.com>2018-08-21 01:28:00 +0200
commitbc16f7f3cce7b3a689f45697d9f6fbd970993e32 (patch)
tree5bdf30d31fda49f68ec7e7ec6d9bb8f4d68db051 /src/video_core
parentMerge pull request #1104 from Subv/instanced_arrays (diff)
downloadyuzu-bc16f7f3cce7b3a689f45697d9f6fbd970993e32.tar
yuzu-bc16f7f3cce7b3a689f45697d9f6fbd970993e32.tar.gz
yuzu-bc16f7f3cce7b3a689f45697d9f6fbd970993e32.tar.bz2
yuzu-bc16f7f3cce7b3a689f45697d9f6fbd970993e32.tar.lz
yuzu-bc16f7f3cce7b3a689f45697d9f6fbd970993e32.tar.xz
yuzu-bc16f7f3cce7b3a689f45697d9f6fbd970993e32.tar.zst
yuzu-bc16f7f3cce7b3a689f45697d9f6fbd970993e32.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_base.cpp8
-rw-r--r--src/video_core/renderer_base.h3
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp13
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h2
4 files changed, 12 insertions, 14 deletions
diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp
index afd86a83a..645d1521a 100644
--- a/src/video_core/renderer_base.cpp
+++ b/src/video_core/renderer_base.cpp
@@ -2,7 +2,6 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include <memory>
#include "core/frontend/emu_window.h"
#include "core/settings.h"
#include "video_core/renderer_base.h"
@@ -17,18 +16,11 @@ RendererBase::RendererBase(Core::Frontend::EmuWindow& window) : render_window{wi
RendererBase::~RendererBase() = default;
void RendererBase::RefreshBaseSettings() {
- RefreshRasterizerSetting();
UpdateCurrentFramebufferLayout();
renderer_settings.use_framelimiter = Settings::values.toggle_framelimit;
}
-void RendererBase::RefreshRasterizerSetting() {
- if (rasterizer == nullptr) {
- rasterizer = std::make_unique<RasterizerOpenGL>(render_window);
- }
-}
-
void RendererBase::UpdateCurrentFramebufferLayout() {
const Layout::FramebufferLayout& layout = render_window.GetFramebufferLayout();
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h
index d9f16b8e6..2a357f9d0 100644
--- a/src/video_core/renderer_base.h
+++ b/src/video_core/renderer_base.h
@@ -58,9 +58,6 @@ public:
void RefreshBaseSettings();
protected:
- /// Refreshes settings specific to the rasterizer.
- void RefreshRasterizerSetting();
-
Core::Frontend::EmuWindow& render_window; ///< Reference to the render window handle.
std::unique_ptr<RasterizerInterface> rasterizer;
f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index bf30eda6d..4a23a931e 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -16,6 +16,7 @@
#include "core/memory.h"
#include "core/settings.h"
#include "core/tracer/recorder.h"
+#include "video_core/renderer_opengl/gl_rasterizer.h"
#include "video_core/renderer_opengl/renderer_opengl.h"
#include "video_core/utils.h"
@@ -142,7 +143,6 @@ void RendererOpenGL::SwapBuffers(boost::optional<const Tegra::FramebufferConfig&
// Restore the rasterizer state
prev_state.Apply();
- RefreshRasterizerSetting();
}
/**
@@ -276,6 +276,14 @@ void RendererOpenGL::InitOpenGLObjects() {
LoadColorToActiveGLTexture(0, 0, 0, 0, screen_info.texture);
}
+void RendererOpenGL::CreateRasterizer() {
+ if (rasterizer) {
+ return;
+ }
+
+ rasterizer = std::make_unique<RasterizerOpenGL>(render_window);
+}
+
void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture,
const Tegra::FramebufferConfig& framebuffer) {
@@ -463,8 +471,7 @@ bool RendererOpenGL::Init() {
}
InitOpenGLObjects();
-
- RefreshRasterizerSetting();
+ CreateRasterizer();
return true;
}
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h
index a5eab6997..6f048ed06 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.h
+++ b/src/video_core/renderer_opengl/renderer_opengl.h
@@ -59,6 +59,8 @@ public:
private:
void InitOpenGLObjects();
+ void CreateRasterizer();
+
void ConfigureFramebufferTexture(TextureInfo& texture,
const Tegra::FramebufferConfig& framebuffer);
void DrawScreen();