mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 07:01:05 +00:00
Non-racing render context, rast state priority
This commit is contained in:
parent
4171d6e7b1
commit
18b7bab98f
@ -28,11 +28,11 @@
|
|||||||
|
|
||||||
EmuThread::EmuThread(GRenderWindow* render_window) :
|
EmuThread::EmuThread(GRenderWindow* render_window) :
|
||||||
exec_step(false), running(false), stop_run(false), render_window(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() {
|
void EmuThread::run() {
|
||||||
|
render_window->MakeCurrent();
|
||||||
|
|
||||||
stop_run = false;
|
stop_run = false;
|
||||||
|
|
||||||
// holds whether the cpu was running during the last iteration,
|
// holds whether the cpu was running during the last iteration,
|
||||||
|
@ -210,6 +210,7 @@ void GMainWindow::BootGame(std::string filename) {
|
|||||||
// Create and start the emulation thread
|
// Create and start the emulation thread
|
||||||
emu_thread = Common::make_unique<EmuThread>(render_window);
|
emu_thread = Common::make_unique<EmuThread>(render_window);
|
||||||
emit EmulationStarting(emu_thread.get());
|
emit EmulationStarting(emu_thread.get());
|
||||||
|
render_window->moveContext();
|
||||||
emu_thread->start();
|
emu_thread->start();
|
||||||
|
|
||||||
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues
|
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues
|
||||||
|
@ -75,10 +75,6 @@ void RasterizerOpenGL::InitObjects() {
|
|||||||
state.draw.vertex_buffer = vertex_buffer.GetHandle();
|
state.draw.vertex_buffer = vertex_buffer.GetHandle();
|
||||||
state.draw.shader_program = shader.GetHandle();
|
state.draw.shader_program = shader.GetHandle();
|
||||||
|
|
||||||
for (auto& texture_unit : state.texture_units) {
|
|
||||||
texture_unit.enabled_2d = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
state.Apply();
|
state.Apply();
|
||||||
|
|
||||||
// Set the texture samplers to correspond to different texture units
|
// Set the texture samplers to correspond to different texture units
|
||||||
|
@ -65,8 +65,7 @@ RendererOpenGL::~RendererOpenGL() {
|
|||||||
|
|
||||||
/// Swap buffers (render frame)
|
/// Swap buffers (render frame)
|
||||||
void RendererOpenGL::SwapBuffers() {
|
void RendererOpenGL::SwapBuffers() {
|
||||||
render_window->MakeCurrent();
|
// Maintain the rasterizer's state as a priority
|
||||||
|
|
||||||
OpenGLState prev_state = OpenGLState::GetCurState();
|
OpenGLState prev_state = OpenGLState::GetCurState();
|
||||||
state.Apply();
|
state.Apply();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user