mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-08-17 00:29:42 +00:00
Updated RenderDoc interface.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
namespace bgfx
|
||||
{
|
||||
pRENDERDOC_GetAPI RENDERDOC_GetAPI;
|
||||
static RENDERDOC_API_1_1_2* s_renderDoc = NULL;
|
||||
static RENDERDOC_API_1_6_0* s_renderDoc = NULL;
|
||||
static void* s_renderDocDll = NULL;
|
||||
|
||||
void* loadRenderDoc()
|
||||
@@ -27,18 +27,25 @@ namespace bgfx
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* renderDocDllName =
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
"renderdoc.dll"
|
||||
#else
|
||||
"librenderdoc.so"
|
||||
#endif // BX_PLATFORM_WINDOWS
|
||||
;
|
||||
|
||||
// If RenderDoc is already injected in the process then use the already present DLL
|
||||
void* renderDocDll = findModule("renderdoc.dll");
|
||||
void* renderDocDll = findModule(renderDocDllName);
|
||||
|
||||
if (NULL == renderDocDll)
|
||||
{
|
||||
// TODO: try common installation paths before looking in current directory
|
||||
renderDocDll = bx::dlopen(
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
"renderdoc.dll"
|
||||
#else
|
||||
"./librenderdoc.so"
|
||||
#endif // BX_PLATFORM_WINDOWS
|
||||
);
|
||||
BX_TRACE("Loading RenderDoc...");
|
||||
renderDocDll = bx::dlopen(renderDocDllName);
|
||||
}
|
||||
else
|
||||
{
|
||||
BX_TRACE("RenderDoc is already loaded.");
|
||||
}
|
||||
|
||||
if (NULL != renderDocDll)
|
||||
@@ -46,7 +53,7 @@ namespace bgfx
|
||||
RENDERDOC_GetAPI = (pRENDERDOC_GetAPI)bx::dlsym(renderDocDll, "RENDERDOC_GetAPI");
|
||||
|
||||
if (NULL != RENDERDOC_GetAPI
|
||||
&& 1 == RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_1_2, (void**)&s_renderDoc) )
|
||||
&& 1 == RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_6_0, (void**)&s_renderDoc) )
|
||||
{
|
||||
s_renderDoc->SetCaptureFilePathTemplate(BGFX_CONFIG_RENDERDOC_LOG_FILEPATH);
|
||||
|
||||
@@ -55,8 +62,8 @@ namespace bgfx
|
||||
RENDERDOC_InputButton captureKeys[] = BGFX_CONFIG_RENDERDOC_CAPTURE_KEYS;
|
||||
s_renderDoc->SetCaptureKeys(captureKeys, BX_COUNTOF(captureKeys) );
|
||||
|
||||
s_renderDoc->SetCaptureOptionU32(eRENDERDOC_Option_AllowVSync, 1);
|
||||
s_renderDoc->SetCaptureOptionU32(eRENDERDOC_Option_SaveAllInitials, 1);
|
||||
s_renderDoc->SetCaptureOptionU32(eRENDERDOC_Option_AllowVSync, 1);
|
||||
s_renderDoc->SetCaptureOptionU32(eRENDERDOC_Option_APIValidation, 1);
|
||||
|
||||
s_renderDoc->MaskOverlayBits(eRENDERDOC_Overlay_None, eRENDERDOC_Overlay_None);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user