GPU: Use --debug-gpu-renderdoc For Renderdoc Integration.
The renderdoc integration used to be behind the `--debug-gpu` command line option. When using `--debug-gpu` outside renderdoc error messages where displayed that aren't relevant. This PR adds a specific command line option for the renderdoc integration. This option will also enable `--debug-gpu`. Pull Request: https://projects.blender.org/blender/blender/pulls/106541
This commit is contained in:
@@ -201,11 +201,12 @@ enum {
|
||||
G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */
|
||||
G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds bypassing detections. */
|
||||
G_DEBUG_GPU_FORCE_DISABLE_SSBO = (1 << 19), /* force disabling usage of SSBO's */
|
||||
G_DEBUG_XR = (1 << 20), /* XR/OpenXR messages */
|
||||
G_DEBUG_XR_TIME = (1 << 21), /* XR/OpenXR timing messages */
|
||||
G_DEBUG_GPU_RENDERDOC = (1 << 20), /* Enable Renderdoc integration. */
|
||||
G_DEBUG_XR = (1 << 21), /* XR/OpenXR messages */
|
||||
G_DEBUG_XR_TIME = (1 << 22), /* XR/OpenXR timing messages */
|
||||
|
||||
G_DEBUG_GHOST = (1 << 22), /* Debug GHOST module. */
|
||||
G_DEBUG_WINTAB = (1 << 23), /* Debug Wintab. */
|
||||
G_DEBUG_GHOST = (1 << 23), /* Debug GHOST module. */
|
||||
G_DEBUG_WINTAB = (1 << 24), /* Debug Wintab. */
|
||||
};
|
||||
|
||||
#define G_DEBUG_ALL \
|
||||
|
||||
@@ -389,10 +389,11 @@ bool GLContext::debug_capture_begin()
|
||||
bool GLBackend::debug_capture_begin()
|
||||
{
|
||||
#ifdef WITH_RENDERDOC
|
||||
return renderdoc_.start_frame_capture(nullptr, nullptr);
|
||||
#else
|
||||
return false;
|
||||
if (G.debug & G_DEBUG_GPU_RENDERDOC) {
|
||||
return renderdoc_.start_frame_capture(nullptr, nullptr);
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
void GLContext::debug_capture_end()
|
||||
@@ -403,7 +404,9 @@ void GLContext::debug_capture_end()
|
||||
void GLBackend::debug_capture_end()
|
||||
{
|
||||
#ifdef WITH_RENDERDOC
|
||||
renderdoc_.end_frame_capture(nullptr, nullptr);
|
||||
if (G.debug & G_DEBUG_GPU_RENDERDOC) {
|
||||
renderdoc_.end_frame_capture(nullptr, nullptr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace blender::gpu {
|
||||
void GPUTest::SetUp()
|
||||
{
|
||||
prev_g_debug_ = G.debug;
|
||||
G.debug |= G_DEBUG_GPU;
|
||||
G.debug |= G_DEBUG_GPU | G_DEBUG_GPU_RENDERDOC;
|
||||
|
||||
CLG_init();
|
||||
GPU_backend_type_selection_set(gpu_backend_type);
|
||||
|
||||
@@ -54,6 +54,10 @@ if(WITH_VULKAN_BACKEND)
|
||||
add_definitions(-DWITH_VULKAN_BACKEND)
|
||||
endif()
|
||||
|
||||
if(WITH_RENDERDOC)
|
||||
add_definitions(-DWITH_RENDERDOC)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
add_definitions(-DWITH_FFMPEG)
|
||||
endif()
|
||||
|
||||
@@ -582,6 +582,9 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
|
||||
BLI_args_print_arg_doc(ba, "--debug-gpu");
|
||||
BLI_args_print_arg_doc(ba, "--debug-gpu-force-workarounds");
|
||||
BLI_args_print_arg_doc(ba, "--debug-gpu-disable-ssbo");
|
||||
# ifdef WITH_RENDERDOC
|
||||
BLI_args_print_arg_doc(ba, "--debug-gpu-renderdoc");
|
||||
# endif
|
||||
BLI_args_print_arg_doc(ba, "--debug-wm");
|
||||
# ifdef WITH_XR_OPENXR
|
||||
BLI_args_print_arg_doc(ba, "--debug-xr");
|
||||
@@ -1118,6 +1121,19 @@ static int arg_handle_debug_gpu_set(int UNUSED(argc),
|
||||
return 0;
|
||||
}
|
||||
|
||||
# ifdef WITH_RENDERDOC
|
||||
static const char arg_handle_debug_gpu_renderdoc_set_doc[] =
|
||||
"\n"
|
||||
"\tEnable Renderdoc integration for GPU frame grabbing and debugging.";
|
||||
static int arg_handle_debug_gpu_renderdoc_set(int UNUSED(argc),
|
||||
const char **UNUSED(argv),
|
||||
void *UNUSED(data))
|
||||
{
|
||||
G.debug |= G_DEBUG_GPU_RENDERDOC | G_DEBUG_GPU;
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
static const char arg_handle_gpu_backend_set_doc[] =
|
||||
"\n"
|
||||
"\tForce to use a specific GPU backend. Valid options: "
|
||||
@@ -2245,6 +2261,9 @@ void main_args_setup(bContext *C, bArgs *ba)
|
||||
CB_EX(arg_handle_debug_mode_generic_set, jobs),
|
||||
(void *)G_DEBUG_JOBS);
|
||||
BLI_args_add(ba, NULL, "--debug-gpu", CB(arg_handle_debug_gpu_set), NULL);
|
||||
# ifdef WITH_RENDERDOC
|
||||
BLI_args_add(ba, NULL, "--debug-gpu-renderdoc", CB(arg_handle_debug_gpu_renderdoc_set), NULL);
|
||||
# endif
|
||||
|
||||
BLI_args_add(ba,
|
||||
NULL,
|
||||
|
||||
Reference in New Issue
Block a user