From f62726b5db97ddf0e3d40a1f84e0e728f5fe2e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 14 Sep 2016 19:38:57 -0700 Subject: [PATCH] Added BGFX_CAPS_GRAPHICS_DEBUGGER. --- include/bgfx/bgfxdefines.h | 1 + src/bgfx.cpp | 2 ++ src/config.h | 8 ++++++++ src/debug_renderdoc.cpp | 6 +++--- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/bgfx/bgfxdefines.h b/include/bgfx/bgfxdefines.h index c16cdaeed..aafb78632 100644 --- a/include/bgfx/bgfxdefines.h +++ b/include/bgfx/bgfxdefines.h @@ -388,6 +388,7 @@ #define BGFX_CAPS_CONSERVATIVE_RASTER UINT64_C(0x0000000000100000) //!< Conservative rasterization is supported. #define BGFX_CAPS_TEXTURE_2D_ARRAY UINT64_C(0x0000000000200000) //!< 2D texture array is supported. #define BGFX_CAPS_TEXTURE_CUBE_ARRAY UINT64_C(0x0000000000400000) //!< Cubemap texture array is supported. +#define BGFX_CAPS_GRAPHICS_DEBUGGER UINT64_C(0x0000000000800000) //!< Graphics debugger is present. /// #define BGFX_CAPS_FORMAT_TEXTURE_NONE UINT16_C(0x0000) //!< Texture format is not supported. diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 404f5227a..1dfe0c6d1 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1103,6 +1103,7 @@ namespace bgfx CAPS_FLAGS(BGFX_CAPS_CONSERVATIVE_RASTER), CAPS_FLAGS(BGFX_CAPS_TEXTURE_2D_ARRAY), CAPS_FLAGS(BGFX_CAPS_TEXTURE_CUBE_ARRAY), + CAPS_FLAGS(BGFX_CAPS_GRAPHICS_DEBUGGER), #undef CAPS_FLAGS }; @@ -1325,6 +1326,7 @@ namespace bgfx g_caps.supported |= 0 | (BX_ENABLED(BGFX_CONFIG_MULTITHREADED) && !m_singleThreaded ? BGFX_CAPS_RENDERER_MULTITHREADED : 0) + | (isGraphicsDebuggerPresent() ? BGFX_CAPS_GRAPHICS_DEBUGGER : 0) ; dumpCaps(); diff --git a/src/config.h b/src/config.h index dd80f94e4..04e3735f3 100644 --- a/src/config.h +++ b/src/config.h @@ -319,4 +319,12 @@ # define BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB BGFX_CONFIG_PROFILER_REMOTERY #endif // BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB +#ifndef BGFX_CONFIG_RENDERDOC_LOG_FILEPATH +# define BGFX_CONFIG_RENDERDOC_LOG_FILEPATH "temp/bgfx" +#endif // BGFX_CONFIG_RENDERDOC_LOG_FILEPATH + +#ifndef BGFX_CONFIG_RENDERDOC_CAPTURE_KEYS +# define BGFX_CONFIG_RENDERDOC_CAPTURE_KEYS { eRENDERDOC_Key_F11 } +#endif // BGFX_CONFIG_RENDERDOC_CAPTURE_KEYS + #endif // BGFX_CONFIG_H_HEADER_GUARD diff --git a/src/debug_renderdoc.cpp b/src/debug_renderdoc.cpp index 0aca62646..db1fabbab 100644 --- a/src/debug_renderdoc.cpp +++ b/src/debug_renderdoc.cpp @@ -74,12 +74,12 @@ namespace bgfx if (NULL != RENDERDOC_GetAPI && 1 == RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_1_0, (void**)&s_renderDoc) ) { - s_renderDoc->SetLogFilePathTemplate("temp/bgfx"); + s_renderDoc->SetLogFilePathTemplate(BGFX_CONFIG_RENDERDOC_LOG_FILEPATH); s_renderDoc->SetFocusToggleKeys(NULL, 0); - RENDERDOC_InputButton captureKey = eRENDERDOC_Key_F11; - s_renderDoc->SetCaptureKeys(&captureKey, 1); + 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);