From 08a3d05e71e0f8baa4558f74edaf7eeecfcdd3c7 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 16 Jul 2020 10:53:58 +0100 Subject: [PATCH] Explicitly note which modifications in pixel history are unavailable --- qrenderdoc/Windows/PixelHistoryView.cpp | 6 ++++++ renderdoc/api/replay/data_types.h | 9 +++++++++ renderdoc/driver/vulkan/vk_pixelhistory.cpp | 3 +++ util/test/tests/Iter_Test.py | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/qrenderdoc/Windows/PixelHistoryView.cpp b/qrenderdoc/Windows/PixelHistoryView.cpp index 6ac927c1f..fa9c5922e 100644 --- a/qrenderdoc/Windows/PixelHistoryView.cpp +++ b/qrenderdoc/Windows/PixelHistoryView.cpp @@ -476,6 +476,9 @@ private: QBrush backgroundBrush(const ModificationValue &val) const { + if(!val.IsValid()) + return QBrush(); + float rangesize = (m_Display.rangeMax - m_Display.rangeMin); float r = val.col.floatValue[0]; @@ -521,6 +524,9 @@ private: { QString s; + if(!val.IsValid()) + return tr("Unavailable"); + int numComps = (int)(m_Tex->format.compCount); if(forceComps > 0) diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 6db47409f..47cb8bd56 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -1770,6 +1770,15 @@ struct ModificationValue DOCUMENT("The stencil output, or ``-1`` if not available."); int32_t stencil; + + DOCUMENT("Returns whether or not this modification value is valid."); + bool IsValid() const { return col.uintValue[0] != 0xdeadbeef || col.uintValue[1] != 0xdeadf00d; } + DOCUMENT("Sets this modification value to be invalid."); + void SetInvalid() + { + col.uintValue[0] = 0xdeadbeef; + col.uintValue[1] = 0xdeadf00d; + } }; DECLARE_REFLECTION_STRUCT(ModificationValue); diff --git a/renderdoc/driver/vulkan/vk_pixelhistory.cpp b/renderdoc/driver/vulkan/vk_pixelhistory.cpp index 66c230b98..c9d9effe3 100644 --- a/renderdoc/driver/vulkan/vk_pixelhistory.cpp +++ b/renderdoc/driver/vulkan/vk_pixelhistory.cpp @@ -3266,6 +3266,9 @@ rdcarray VulkanReplay::PixelHistory(rdcarray even if(eventIndex == -1) { // There is no information, skip the event. + mod.preMod.SetInvalid(); + mod.postMod.SetInvalid(); + mod.shaderOut.SetInvalid(); h++; continue; } diff --git a/util/test/tests/Iter_Test.py b/util/test/tests/Iter_Test.py index 913b5f20f..2a416541d 100644 --- a/util/test/tests/Iter_Test.py +++ b/util/test/tests/Iter_Test.py @@ -218,6 +218,11 @@ class Iter_Test(rdtest.TestCase): lastmod = None continue + if not mod.shaderOut.IsValid(): + rdtest.log.print("This hit's shader out is not valid, looking for one that valid....") + lastmod = None + continue + break if target == pipe.GetDepthTarget().resourceId: