Expose a function to fetch the debug overlay's texture ID

This commit is contained in:
baldurk
2017-04-27 15:10:53 +01:00
parent b5e6596512
commit f415681f65
4 changed files with 29 additions and 0 deletions
+10
View File
@@ -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.
+1
View File
@@ -55,6 +55,7 @@ public:
rdctype::array<uint32_t> 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<uint32_t, uint32_t> PickVertex(uint32_t eventID, uint32_t x, uint32_t y);
+7
View File
@@ -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)
+11
View File
@@ -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));