From 27f2a4b7f9c52006f20fd3268dab69a8449eb552 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 30 Mar 2020 19:48:59 +0100 Subject: [PATCH] Don't modify states/variables list on replay thread * Otherwise this can race with the UI thread if it's executing a shortcut. --- qrenderdoc/Windows/ShaderViewer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index 2251374d6..0bb1900f0 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -620,15 +620,15 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR r->SetFrameEvent(m_Ctx.CurEvent(), true); - m_States = states; + GUIInvoke::call(this, [this, states]() { + m_States = states; - if(!m_States.empty()) - { - for(const ShaderVariableChange &c : GetCurrentState().changes) - m_Variables.push_back(c.after); - } + if(!m_States.empty()) + { + for(const ShaderVariableChange &c : GetCurrentState().changes) + m_Variables.push_back(c.after); + } - GUIInvoke::call(this, [this]() { bool preferSourceDebug = false; for(const ShaderCompileFlag &flag : m_ShaderDetails->debugInfo.compileFlags.flags)