Add externally visible API to query for pixel history

This commit is contained in:
baldurk
2014-07-13 18:56:45 +01:00
parent 25c4771589
commit 4e51aab9e5
15 changed files with 209 additions and 3 deletions
+21
View File
@@ -457,6 +457,27 @@ namespace renderdoc
public ValueUnion value;
};
[StructLayout(LayoutKind.Sequential)]
public class PixelModification
{
public UInt32 eventID;
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
public PixelValue preMod;
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
public PixelValue shaderOut;
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
public PixelValue postMod;
public bool backfaceCulled;
public bool depthClipped;
public bool viewClipped;
public bool scissorClipped;
public bool shaderDiscarded;
public bool depthTestFailed;
public bool stencilTestFailed;
};
[StructLayout(LayoutKind.Sequential)]
public class PostVSMeshData
{
+19 -1
View File
@@ -209,7 +209,9 @@ namespace renderdoc
private static extern bool ReplayRenderer_GetResolve(IntPtr real, UInt64[] callstack, UInt32 callstackLen, IntPtr outtrace);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr ReplayRenderer_GetShaderDetails(IntPtr real, ResourceId shader);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern bool ReplayRenderer_PixelHistory(IntPtr real, ResourceId target, UInt32 x, UInt32 y, IntPtr history);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern bool ReplayRenderer_VSGetDebugStates(IntPtr real, UInt32 vertid, UInt32 instid, UInt32 idx, UInt32 instOffset, UInt32 vertOffset, IntPtr outtrace);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
@@ -488,6 +490,22 @@ namespace renderdoc
return ret;
}
public PixelModification[] PixelHistory(ResourceId target, UInt32 x, UInt32 y)
{
IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));
bool success = ReplayRenderer_PixelHistory(m_Real, target, x, y, mem);
PixelModification[] ret = null;
if (success)
ret = (PixelModification[])CustomMarshal.GetTemplatedArray(mem, typeof(PixelModification), true);
CustomMarshal.Free(mem);
return ret;
}
public ShaderDebugTrace VSGetDebugStates(UInt32 vertid, UInt32 instid, UInt32 idx, UInt32 instOffset, UInt32 vertOffset)
{
IntPtr mem = CustomMarshal.Alloc(typeof(ShaderDebugTrace));