diff --git a/renderdocui/Windows/TextureViewer.cs b/renderdocui/Windows/TextureViewer.cs index 9d44eadcb..7179c43e8 100644 --- a/renderdocui/Windows/TextureViewer.cs +++ b/renderdocui/Windows/TextureViewer.cs @@ -2588,15 +2588,23 @@ namespace renderdocui.Windows hist.Show(DockPanel); - m_Core.Renderer.BeginInvoke((ReplayRenderer r) => + // add a short delay so that controls repainting after a new panel appears can get at the + // render thread before we insert the long blocking pixel history task + var delayedHistory = new BackgroundWorker(); + delayedHistory.DoWork += delegate { - history = r.PixelHistory(CurrentTexture.ID, (UInt32)m_PickedPoint.X, (UInt32)m_PickedPoint.Y); - - this.BeginInvoke(new Action(() => + Thread.Sleep(100); + m_Core.Renderer.BeginInvoke((ReplayRenderer r) => { - hist.SetHistory(history); - })); - }); + history = r.PixelHistory(CurrentTexture.ID, (UInt32)m_PickedPoint.X, (UInt32)m_PickedPoint.Y); + + this.BeginInvoke(new Action(() => + { + hist.SetHistory(history); + })); + }); + }; + delayedHistory.RunWorkerAsync(); } private void debugPixel_Click(object sender, EventArgs e)