Allow specifying a listen interface and port, for remote replaying

This commit is contained in:
baldurk
2016-07-12 15:56:56 +02:00
parent aaa2bd1d7d
commit 73dc89f25a
8 changed files with 44 additions and 20 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ namespace renderdocui.Code
return;
}
remote = StaticExports.CreateRemoteReplayConnection(m_ReplayHost);
remote = StaticExports.CreateRemoteReplayConnection(m_ReplayHost, 0);
if(remote == null)
{
+10 -6
View File
@@ -54,13 +54,13 @@ namespace renderdoc
private static extern UInt32 RENDERDOC_EnumerateRemoteConnections(IntPtr host, UInt32 nextIdent);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern ReplayCreateStatus RENDERDOC_CreateRemoteReplayConnection(IntPtr host, ref IntPtr outrend);
private static extern ReplayCreateStatus RENDERDOC_CreateRemoteReplayConnection(IntPtr host, UInt32 port, 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);
private static extern void RENDERDOC_SpawnReplayHost(IntPtr host, UInt32 port, ref bool killReplay);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void RENDERDOC_TriggerExceptionHandler(IntPtr exceptionPtrs, bool crashed);
@@ -202,13 +202,13 @@ namespace renderdoc
CustomMarshal.Free(host_mem);
}
public static RemoteRenderer CreateRemoteReplayConnection(string host)
public static RemoteRenderer CreateRemoteReplayConnection(string host, uint port)
{
IntPtr rendPtr = IntPtr.Zero;
IntPtr host_mem = CustomMarshal.MakeUTF8String(host);
ReplayCreateStatus ret = RENDERDOC_CreateRemoteReplayConnection(host_mem, ref rendPtr);
ReplayCreateStatus ret = RENDERDOC_CreateRemoteReplayConnection(host_mem, port, ref rendPtr);
CustomMarshal.Free(host_mem);
@@ -222,9 +222,13 @@ namespace renderdoc
return new RemoteRenderer(rendPtr);
}
public static void SpawnReplayHost(ref bool killReplay)
public static void SpawnReplayHost(string host, uint port, ref bool killReplay)
{
RENDERDOC_SpawnReplayHost(ref killReplay);
IntPtr host_mem = CustomMarshal.MakeUTF8String(host);
RENDERDOC_SpawnReplayHost(host_mem, port, ref killReplay);
CustomMarshal.Free(host_mem);
}
public static void TriggerExceptionHandler(IntPtr exceptionPtrs, bool crashed)
@@ -62,7 +62,7 @@ namespace renderdocui.Windows.Dialogs
string[] proxies = new string[0];
try
{
var dummy = StaticExports.CreateRemoteReplayConnection("-");
var dummy = StaticExports.CreateRemoteReplayConnection("-", 0);
proxies = dummy.LocalProxies();
dummy.Shutdown();
}
+3 -3
View File
@@ -673,7 +673,7 @@ namespace renderdocui.Windows
string[] drivers = new string[0];
try
{
var dummy = StaticExports.CreateRemoteReplayConnection(m_RemoteReplay);
var dummy = StaticExports.CreateRemoteReplayConnection(m_RemoteReplay, 0);
drivers = dummy.RemoteSupportedReplays();
dummy.Shutdown();
}
@@ -708,7 +708,7 @@ namespace renderdocui.Windows
string[] proxies = new string[0];
try
{
var dummy = StaticExports.CreateRemoteReplayConnection("-");
var dummy = StaticExports.CreateRemoteReplayConnection("-", 0);
proxies = dummy.LocalProxies();
dummy.Shutdown();
}
@@ -1498,7 +1498,7 @@ namespace renderdocui.Windows
Thread thread = Helpers.NewThread(new ThreadStart(() =>
{
StaticExports.SpawnReplayHost(ref killReplay);
StaticExports.SpawnReplayHost("", 0, ref killReplay);
}));
thread.Start();