diff --git a/3rdparty/renderdoc/renderdoc_app.h b/3rdparty/renderdoc/renderdoc_app.h index d941f586..f0df30e4 100644 --- a/3rdparty/renderdoc/renderdoc_app.h +++ b/3rdparty/renderdoc/renderdoc_app.h @@ -182,7 +182,12 @@ enum InAppOverlay // API breaking change history: // Version 1 -> 2 - strings changed from wchar_t* to char* (UTF-8) -#define RENDERDOC_API_VERSION 2 +// Version 2 -> 3 - StartFrameCapture, EndFrameCapture and SetActiveWindow take +// 'device' pointer as well as window handles. +// This is either ID3D11Device* or the GL context (HGLRC/GLXContext) +// You can still pass NULL to both to capture the default, as long as +// there's only one device/window pair alive. +#define RENDERDOC_API_VERSION 3 ////////////////////////////////////////////////////////////////////////// // In-program functions @@ -191,6 +196,9 @@ enum InAppOverlay extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_GetAPIVersion(); typedef int (RENDERDOC_CC *pRENDERDOC_GetAPIVersion)(); +extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_Shutdown(); +typedef void (RENDERDOC_CC *pRENDERDOC_Shutdown)(); + extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetLogFile(const char *logfile); typedef void (RENDERDOC_CC *pRENDERDOC_SetLogFile)(const char *logfile); @@ -203,17 +211,17 @@ typedef uint32_t (RENDERDOC_CC *pRENDERDOC_GetCapture)(uint32_t idx, char *logfi extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetCaptureOptions(const CaptureOptions *opts); typedef void (RENDERDOC_CC *pRENDERDOC_SetCaptureOptions)(const CaptureOptions *opts); -extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetActiveWindow(void *wndHandle); -typedef void (RENDERDOC_CC *pRENDERDOC_SetActiveWindow)(void *wndHandle); +extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetActiveWindow(void *device, void *wndHandle); +typedef void (RENDERDOC_CC *pRENDERDOC_SetActiveWindow)(void *device, void *wndHandle); extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_TriggerCapture(); typedef void (RENDERDOC_CC *pRENDERDOC_TriggerCapture)(); -extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_StartFrameCapture(void *wndHandle); -typedef void (RENDERDOC_CC *pRENDERDOC_StartFrameCapture)(void *wndHandle); +extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_StartFrameCapture(void *device, void *wndHandle); +typedef void (RENDERDOC_CC *pRENDERDOC_StartFrameCapture)(void *device, void *wndHandle); -extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_EndFrameCapture(void *wndHandle); -typedef uint32_t (RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(void *wndHandle); +extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_EndFrameCapture(void *device, void *wndHandle); +typedef uint32_t (RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(void *device, void *wndHandle); extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_GetOverlayBits(); typedef uint32_t (RENDERDOC_CC *pRENDERDOC_GetOverlayBits)(); diff --git a/src/renderdoc.cpp b/src/renderdoc.cpp index c6adc5f0..84ae5112 100644 --- a/src/renderdoc.cpp +++ b/src/renderdoc.cpp @@ -56,6 +56,7 @@ namespace bgfx } #define RENDERDOC_IMPORT \ + RENDERDOC_IMPORT_FUNC(RENDERDOC_Shutdown); \ RENDERDOC_IMPORT_FUNC(RENDERDOC_SetLogFile); \ RENDERDOC_IMPORT_FUNC(RENDERDOC_GetCapture); \ RENDERDOC_IMPORT_FUNC(RENDERDOC_SetCaptureOptions); \ @@ -67,7 +68,8 @@ namespace bgfx RENDERDOC_IMPORT_FUNC(RENDERDOC_MaskOverlayBits); \ RENDERDOC_IMPORT_FUNC(RENDERDOC_SetFocusToggleKeys); \ RENDERDOC_IMPORT_FUNC(RENDERDOC_SetCaptureKeys); \ - RENDERDOC_IMPORT_FUNC(RENDERDOC_InitRemoteAccess); + RENDERDOC_IMPORT_FUNC(RENDERDOC_InitRemoteAccess); \ + RENDERDOC_IMPORT_FUNC(RENDERDOC_UnloadCrashHandler); #define RENDERDOC_IMPORT_FUNC(_func) p##_func _func RENDERDOC_IMPORT @@ -129,6 +131,7 @@ RENDERDOC_IMPORT { if (NULL != _renderdocdll) { + RENDERDOC_Shutdown(); bx::dlclose(_renderdocdll); } }