mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add easy support for self-hosted captures on windows only
* By renaming the renderdoc and renderdoccmd projects to something else (say 'selfhost' and 'selfhostcmd') then they can be used to capture renderdocui and the replaying that's happening. * Only supported on development builds and might break down, but it's handy to have as an easy to enable option. * There's also a couple of handy python functions exposed - renderdoc.StaticExports.StartSelfHostCapture(string dllname) renderdoc.StaticExports.EndSelfHostCapture(string dllname) which can be used to start and stop the capture around e.g. a shader debug operation or a pixel history operation or something similar.
This commit is contained in:
@@ -46,7 +46,7 @@ namespace renderdoc
|
||||
public ReplayCreateStatus Status;
|
||||
}
|
||||
|
||||
class StaticExports
|
||||
public class StaticExports
|
||||
{
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern ReplaySupport RENDERDOC_SupportLocalReplay(IntPtr logfile, IntPtr outdriver, IntPtr outident);
|
||||
@@ -110,6 +110,30 @@ namespace renderdoc
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern void RENDERDOC_FreeEnvironmentModificationList(IntPtr mem);
|
||||
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern void RENDERDOC_StartSelfHostCapture(IntPtr dllname);
|
||||
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern void RENDERDOC_EndSelfHostCapture(IntPtr dllname);
|
||||
|
||||
public static void StartSelfHostCapture(string dllname)
|
||||
{
|
||||
IntPtr mem = CustomMarshal.MakeUTF8String(dllname);
|
||||
|
||||
RENDERDOC_StartSelfHostCapture(mem);
|
||||
|
||||
CustomMarshal.Free(mem);
|
||||
}
|
||||
|
||||
public static void EndSelfHostCapture(string dllname)
|
||||
{
|
||||
IntPtr mem = CustomMarshal.MakeUTF8String(dllname);
|
||||
|
||||
RENDERDOC_EndSelfHostCapture(mem);
|
||||
|
||||
CustomMarshal.Free(mem);
|
||||
}
|
||||
|
||||
public static ReplaySupport SupportLocalReplay(string logfile, out string driverName, out string recordMachineIdent)
|
||||
{
|
||||
IntPtr name_mem = CustomMarshal.Alloc(typeof(templated_array));
|
||||
|
||||
Reference in New Issue
Block a user