From 18b7bab98fd1cdf5b9c38a8ea510d09f4598fdfc Mon Sep 17 00:00:00 2001 From: tfarley Date: Mon, 18 May 2015 14:10:12 -0700 Subject: [PATCH] Non-racing render context, rast state priority --- src/citra_qt/bootmanager.cpp | 4 ++-- src/citra_qt/main.cpp | 1 + src/video_core/renderer_opengl/gl_rasterizer.cpp | 4 ---- src/video_core/renderer_opengl/renderer_opengl.cpp | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index d3df289f8..6986a0d31 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -28,11 +28,11 @@ EmuThread::EmuThread(GRenderWindow* render_window) : exec_step(false), running(false), stop_run(false), render_window(render_window) { - - connect(this, SIGNAL(started()), render_window, SLOT(moveContext())); } void EmuThread::run() { + render_window->MakeCurrent(); + stop_run = false; // holds whether the cpu was running during the last iteration, diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 24506deab..495b0ae65 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -210,6 +210,7 @@ void GMainWindow::BootGame(std::string filename) { // Create and start the emulation thread emu_thread = Common::make_unique(render_window); emit EmulationStarting(emu_thread.get()); + render_window->moveContext(); emu_thread->start(); // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index fc7023c95..b02da6aaf 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -75,10 +75,6 @@ void RasterizerOpenGL::InitObjects() { state.draw.vertex_buffer = vertex_buffer.GetHandle(); state.draw.shader_program = shader.GetHandle(); - for (auto& texture_unit : state.texture_units) { - texture_unit.enabled_2d = true; - } - state.Apply(); // Set the texture samplers to correspond to different texture units diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 1258e81cf..63a1c2dfa 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -65,8 +65,7 @@ RendererOpenGL::~RendererOpenGL() { /// Swap buffers (render frame) void RendererOpenGL::SwapBuffers() { - render_window->MakeCurrent(); - + // Maintain the rasterizer's state as a priority OpenGLState prev_state = OpenGLState::GetCurState(); state.Apply();