From 9db801c3dbccd37fe4ca9980c743246613eedb3f Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Wed, 30 Mar 2016 13:14:02 +0200 Subject: [PATCH] Only check for enabled JIT in Setup() to avoid race conditions --- src/video_core/shader/shader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index 9080cb397..2e6c64b75 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -107,6 +107,8 @@ void ShaderSetup::Setup() { jit_shader = shader; shader_map[cache_key] = std::move(shader); } + } else { + jit_shader.reset(); } #endif // ARCHITECTURE_x86_64 } @@ -130,8 +132,8 @@ void ShaderSetup::Run(UnitState& state, const InputVertex& input, int num state.conditional_code[1] = false; #ifdef ARCHITECTURE_x86_64 - if (VideoCore::g_shader_jit_enabled) - jit_shader.lock().get()->Run(*this, state, config.main_offset); + if (auto shader = jit_shader.lock()) + shader.get()->Run(*this, state, config.main_offset); else RunInterpreter(*this, state, config.main_offset); #else