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:
baldurk committed 2016-10-25 19:50:04 +02:00
1 parent aa5c55e4e4
commit f368a65843
8 files changed
+93 -19

No files matched your search

+46
View File
@@ -545,3 +545,49 @@ extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_BecomeRemoteServer(const ch
RenderDoc::Inst().BecomeRemoteServer(listenhost, (uint16_t)port, *killReplay);
}
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_StartSelfHostCapture(const char *dllname)
{
void *module = Process::LoadModule(dllname);
if(module == NULL)
return;
pRENDERDOC_GetAPI get =
(pRENDERDOC_GetAPI)Process::GetFunctionAddress(module, "RENDERDOC_GetAPI");
if(get == NULL)
return;
RENDERDOC_API_1_0_0 *rdoc = NULL;
get(eRENDERDOC_API_Version_1_0_0, (void **)&rdoc);
if(rdoc == NULL)
return;
rdoc->StartFrameCapture(NULL, NULL);
}
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_EndSelfHostCapture(const char *dllname)
{
void *module = Process::LoadModule(dllname);
if(module == NULL)
return;
pRENDERDOC_GetAPI get =
(pRENDERDOC_GetAPI)Process::GetFunctionAddress(module, "RENDERDOC_GetAPI");
if(get == NULL)
return;
RENDERDOC_API_1_0_0 *rdoc = NULL;
get(eRENDERDOC_API_Version_1_0_0, (void **)&rdoc);
if(rdoc == NULL)
return;
rdoc->EndFrameCapture(NULL, NULL);
}