From b8b9fff7f02782a7940ba045782ccbe9398ce308 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 25 Jan 2023 10:38:16 +0000 Subject: [PATCH] Fix order, update texture before fetching histogram. Closes #2828 * This is only relevant when using a custom shader since otherwise nothing is 'updated', though could also affect overlays potentially. If we don't then the custom shader texture may not have been re-rendered before we fetch the histogram data and we'll get stale information. --- qrenderdoc/Windows/TextureViewer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index bb2574d3a..d51727f81 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -1581,12 +1581,12 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newAction) AutoFitRange(); m_Ctx.Replay().AsyncInvoke([this](IReplayController *r) { - RT_UpdateVisualRange(r); - RT_UpdateAndDisplay(r); if(m_Output != NULL) RT_PickPixelsAndUpdate(r); + + RT_UpdateVisualRange(r); }); HighlightUsage(); @@ -3815,14 +3815,14 @@ void TextureViewer::on_mipLevel_currentIndexChanged(int index) return; } - INVOKE_MEMFN(RT_UpdateVisualRange); + INVOKE_MEMFN(RT_UpdateAndDisplay); if(m_Output != NULL && m_PickedPoint.x() >= 0 && m_PickedPoint.y() >= 0) { INVOKE_MEMFN(RT_PickPixelsAndUpdate); } - INVOKE_MEMFN(RT_UpdateAndDisplay); + INVOKE_MEMFN(RT_UpdateVisualRange); } void TextureViewer::on_sliceFace_currentIndexChanged(int index) @@ -3834,14 +3834,14 @@ void TextureViewer::on_sliceFace_currentIndexChanged(int index) TextureDescription &tex = *texptr; m_TexDisplay.subresource.slice = (uint32_t)qMax(0, index); + INVOKE_MEMFN(RT_UpdateAndDisplay); + INVOKE_MEMFN(RT_UpdateVisualRange); if(m_Output != NULL && m_PickedPoint.x() >= 0 && m_PickedPoint.y() >= 0) { INVOKE_MEMFN(RT_PickPixelsAndUpdate); } - - INVOKE_MEMFN(RT_UpdateAndDisplay); } void TextureViewer::on_locationGoto_clicked()