Save machine ident in captures and compare to machine ident on open

* If the machine idents differ in significant ways that we'd consider
  it to be a different platform (currently just OS), and if so mark it
  as supported but suggested to be replayed remotely.
This commit is contained in:
baldurk
2016-08-19 12:44:20 +02:00
parent 52a754d4c1
commit d2faf76356
19 changed files with 155 additions and 28 deletions
+7
View File
@@ -504,6 +504,13 @@ namespace renderdoc
Percentage,
};
public enum ReplaySupport
{
Unsupported,
Supported,
SuggestRemote,
};
public enum ReplayCreateStatus
{
Success = 0,
+10 -6
View File
@@ -49,7 +49,7 @@ namespace renderdoc
class StaticExports
{
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern bool RENDERDOC_SupportLocalReplay(IntPtr logfile, IntPtr outdriver);
private static extern ReplaySupport RENDERDOC_SupportLocalReplay(IntPtr logfile, IntPtr outdriver, IntPtr outident);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern ReplayCreateStatus RENDERDOC_CreateReplayRenderer(IntPtr logfile, ref float progress, ref IntPtr rendPtr);
@@ -110,19 +110,23 @@ namespace renderdoc
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void RENDERDOC_FreeEnvironmentModificationList(IntPtr mem);
public static bool SupportLocalReplay(string logfile, out string driverName)
public static ReplaySupport SupportLocalReplay(string logfile, out string driverName, out string recordMachineIdent)
{
IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));
IntPtr name_mem = CustomMarshal.Alloc(typeof(templated_array));
IntPtr ident_mem = CustomMarshal.Alloc(typeof(templated_array));
IntPtr logfile_mem = CustomMarshal.MakeUTF8String(logfile);
bool ret = RENDERDOC_SupportLocalReplay(logfile_mem, mem);
ReplaySupport ret = RENDERDOC_SupportLocalReplay(logfile_mem, name_mem, ident_mem);
CustomMarshal.Free(logfile_mem);
driverName = CustomMarshal.TemplatedArrayToString(mem, true);
driverName = CustomMarshal.TemplatedArrayToString(name_mem, true);
recordMachineIdent = CustomMarshal.TemplatedArrayToString(ident_mem, true);
CustomMarshal.Free(name_mem);
CustomMarshal.Free(ident_mem);
CustomMarshal.Free(mem);
return ret;
}