diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h index 7a787f879..64cfbb21c 100644 --- a/renderdoc/api/replay/renderdoc_replay.h +++ b/renderdoc/api/replay/renderdoc_replay.h @@ -341,6 +341,16 @@ Should only be called for texture outputs. )"); virtual ResourceId GetCustomShaderTexID() = 0; + DOCUMENT(R"(Retrieves the :class:`ResourceId` containing the contents of the debug overlay +rendering (if enabled). + +Should only be called for texture outputs. + +:return: The :class:`ResourceId` assigned to the texture with the debug overlay. +:rtype: ResourceId +)"); + virtual ResourceId GetDebugOverlayTexID() = 0; + DOCUMENT(R"(Retrieve the contents of a particular pixel in a texture. Should only be called for texture outputs. diff --git a/renderdoc/replay/replay_controller.h b/renderdoc/replay/replay_controller.h index e9a973023..895a70ddf 100644 --- a/renderdoc/replay/replay_controller.h +++ b/renderdoc/replay/replay_controller.h @@ -55,6 +55,7 @@ public: rdctype::array GetHistogram(float minval, float maxval, bool channels[4]); ResourceId GetCustomShaderTexID() { return m_CustomShaderResourceId; } + ResourceId GetDebugOverlayTexID() { return m_OverlayResourceId; } PixelValue PickPixel(ResourceId texID, bool customShader, uint32_t x, uint32_t y, uint32_t sliceFace, uint32_t mip, uint32_t sample); rdctype::pair PickVertex(uint32_t eventID, uint32_t x, uint32_t y); diff --git a/renderdoc/replay/replay_output.cpp b/renderdoc/replay/replay_output.cpp index c87da6893..84d9f2c53 100644 --- a/renderdoc/replay/replay_output.cpp +++ b/renderdoc/replay/replay_output.cpp @@ -892,6 +892,13 @@ extern "C" RENDERDOC_API void RENDERDOC_CC ReplayOutput_GetCustomShaderTexID(IRe *id = output->GetCustomShaderTexID(); } +extern "C" RENDERDOC_API void RENDERDOC_CC ReplayOutput_GetDebugOverlayTexID(IReplayOutput *output, + ResourceId *id) +{ + if(id) + *id = output->GetDebugOverlayTexID(); +} + extern "C" RENDERDOC_API void RENDERDOC_CC ReplayOutput_GetMinMax(IReplayOutput *output, PixelValue *minval, PixelValue *maxval) diff --git a/renderdocui/Interop/ReplayRenderer.cs b/renderdocui/Interop/ReplayRenderer.cs index a0e55feeb..4bc7d09cd 100644 --- a/renderdocui/Interop/ReplayRenderer.cs +++ b/renderdocui/Interop/ReplayRenderer.cs @@ -140,6 +140,8 @@ namespace renderdoc [DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] private static extern void ReplayOutput_GetCustomShaderTexID(IntPtr real, ref ResourceId texid); + [DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + private static extern void ReplayOutput_GetDebugOverlayTexID(IntPtr real, ref ResourceId texid); [DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] private static extern void ReplayOutput_GetMinMax(IntPtr real, IntPtr outminval, IntPtr outmaxval); @@ -203,6 +205,15 @@ namespace renderdoc return ret; } + public ResourceId GetDebugOverlayTexID() + { + ResourceId ret = ResourceId.Null; + + ReplayOutput_GetDebugOverlayTexID(m_Real, ref ret); + + return ret; + } + public void GetMinMax(out PixelValue minval, out PixelValue maxval) { IntPtr mem1 = CustomMarshal.Alloc(typeof(PixelValue));