From 8dd69268ba41caa757e24999586f999d64a25da3 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 25 May 2018 18:10:22 +0100 Subject: [PATCH] As a last fallback in replay loop, use biggest colour rendertarget --- qrenderdoc/Windows/MainWindow.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index 699a2a3e0..dec456caf 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -2242,6 +2242,21 @@ void MainWindow::on_action_Start_Replay_Loop_triggered() } } + if(!displayTex) + { + // if still no texture was found, then use the biggest colour render target + for(const TextureDescription &tex : m_Ctx.GetTextures()) + { + if((tex.creationFlags & TextureCategory::ColorTarget) && + tex.format.compType != CompType::Depth && tex.format.type != ResourceFormatType::D16S8 && + tex.format.type != ResourceFormatType::D24S8 && tex.format.type != ResourceFormatType::D32S8) + { + if(displayTex == NULL || tex.width * tex.height > displayTex->width * displayTex->height) + displayTex = &tex; + } + } + } + ResourceId id; if(displayTex)