Update RenderDoc application-facing API to a stable/mature version.

* This API is now intended to be forward and backward compatible as much
  as possible. Meaning applications should be able to run without
  changing on many RenderDoc versions after the one they are built
  against without breaking.
* All function pointers are fetched at once in one versioned GetAPI()
  function, to save on constant GetProcAddress/dlsym'ing.
* Otherwise, it's largely similar to the previous API.
This commit is contained in:
baldurk
2015-08-23 15:12:05 +02:00
parent a54fc564ad
commit 4609fa710b
19 changed files with 1116 additions and 509 deletions
+1 -20
View File
@@ -78,25 +78,6 @@ namespace renderdoc
public bool RefAllResources;
public bool SaveAllInitials;
public bool CaptureAllCmdLists;
public static CaptureOptions Defaults
{
get
{
CaptureOptions defs = new CaptureOptions();
defs.AllowVSync = true;
defs.AllowFullscreen = true;
defs.DebugDeviceMode = false;
defs.CaptureCallstacks = false;
defs.CaptureCallstacksOnlyDraws = false;
defs.DelayForDebugger = 0;
defs.VerifyMapWrites = false;
defs.HookIntoChildren = false;
defs.RefAllResources = false;
defs.SaveAllInitials = false;
defs.CaptureAllCmdLists = false;
return defs;
}
}
public bool DebugOutputMute;
};
};
+16
View File
@@ -55,6 +55,9 @@ namespace renderdoc
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern ReplayCreateStatus RENDERDOC_CreateRemoteReplayConnection(IntPtr host, ref IntPtr outrend);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void RENDERDOC_GetDefaultCaptureOptions(IntPtr outopts);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void RENDERDOC_SpawnReplayHost(ref bool killReplay);
@@ -255,5 +258,18 @@ namespace renderdoc
return ret;
}
public static CaptureOptions GetDefaultCaptureOptions()
{
IntPtr mem = CustomMarshal.Alloc(typeof(CaptureOptions));
RENDERDOC_GetDefaultCaptureOptions(mem);
CaptureOptions ret = (CaptureOptions)CustomMarshal.PtrToStructure(mem, typeof(CaptureOptions), true);
CustomMarshal.Free(mem);
return ret;
}
}
}
+1 -1
View File
@@ -46,7 +46,7 @@ namespace renderdocui.Windows.Dialogs
{
public class CaptureSettings
{
public CaptureOptions Options = CaptureOptions.Defaults;
public CaptureOptions Options = StaticExports.GetDefaultCaptureOptions();
public bool Inject = false;
public bool AutoStart = false;
public string Executable = "";