From 8639e616cfb0f3ebde421af328902d24320b9585 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 11 Oct 2017 11:32:16 +0100 Subject: [PATCH] Don't divide by zero if there are no textures to fetch stats for --- qrenderdoc/Windows/StatisticsViewer.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/qrenderdoc/Windows/StatisticsViewer.cpp b/qrenderdoc/Windows/StatisticsViewer.cpp index bb1f67d27..a737fa53d 100644 --- a/qrenderdoc/Windows/StatisticsViewer.cpp +++ b/qrenderdoc/Windows/StatisticsViewer.cpp @@ -746,11 +746,17 @@ void StatisticsViewer::GenerateReport() } } - texW /= texCount; - texH /= texCount; + if(texCount > 0) + { + texW /= texCount; + texH /= texCount; + } - largeTexW /= largeTexCount; - largeTexH /= largeTexCount; + if(largeTexCount > 0) + { + largeTexW /= largeTexCount; + largeTexH /= largeTexCount; + } const FrameDescription &frameInfo = m_Ctx.FrameInfo();