mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
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:
@@ -504,6 +504,13 @@ namespace renderdoc
|
||||
Percentage,
|
||||
};
|
||||
|
||||
public enum ReplaySupport
|
||||
{
|
||||
Unsupported,
|
||||
Supported,
|
||||
SuggestRemote,
|
||||
};
|
||||
|
||||
public enum ReplayCreateStatus
|
||||
{
|
||||
Success = 0,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -625,24 +625,25 @@ namespace renderdocui.Windows
|
||||
if (m_Core.LogLoading) return;
|
||||
|
||||
string driver = "";
|
||||
bool support = false;
|
||||
string machineIdent = "";
|
||||
ReplaySupport support = ReplaySupport.Unsupported;
|
||||
|
||||
bool remoteReplay = !local || (m_Core.Renderer.Remote != null && m_Core.Renderer.Remote.Connected);
|
||||
|
||||
if (local)
|
||||
{
|
||||
support = StaticExports.SupportLocalReplay(filename, out driver);
|
||||
support = StaticExports.SupportLocalReplay(filename, out driver, out machineIdent);
|
||||
|
||||
if (remoteReplay)
|
||||
{
|
||||
support = false;
|
||||
support = ReplaySupport.Unsupported;
|
||||
|
||||
string[] remoteDrivers = m_Core.Renderer.GetRemoteSupport();
|
||||
|
||||
for (int i = 0; i < remoteDrivers.Length; i++)
|
||||
{
|
||||
if (driver == remoteDrivers[i])
|
||||
support = true;
|
||||
support = ReplaySupport.Supported;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -651,7 +652,7 @@ namespace renderdocui.Windows
|
||||
|
||||
// if driver is empty something went wrong loading the log, let it be handled as usual
|
||||
// below. Otherwise indicate that support is missing.
|
||||
if (driver.Length > 0 && !support)
|
||||
if (driver.Length > 0 && support == ReplaySupport.Unsupported)
|
||||
{
|
||||
if (remoteReplay)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user