diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index e28c87cd7d6..f3acb7d3746 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -189,15 +189,16 @@ enum { * assigned to ID datablocks */ G_DEBUG_DEPSGRAPH = (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_EVAL | G_DEBUG_DEPSGRAPH_TAG | G_DEBUG_DEPSGRAPH_TIME | G_DEBUG_DEPSGRAPH_UUID), - G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */ - G_DEBUG_GPU = (1 << 16), /* gpu debug */ - G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */ - G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds bypassing detections. */ - G_DEBUG_XR = (1 << 19), /* XR/OpenXR messages */ - G_DEBUG_XR_TIME = (1 << 20), /* XR/OpenXR timing messages */ + G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */ + G_DEBUG_GPU = (1 << 16), /* gpu debug */ + 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_GHOST = (1 << 21), /* Debug GHOST module. */ - G_DEBUG_WINTAB = (1 << 22), /* Debug Wintab. */ + G_DEBUG_GHOST = (1 << 22), /* Debug GHOST module. */ + G_DEBUG_WINTAB = (1 << 23), /* Debug Wintab. */ }; #define G_DEBUG_ALL \ diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc index 9051003bcd5..49a2321af98 100644 --- a/source/blender/gpu/opengl/gl_backend.cc +++ b/source/blender/gpu/opengl/gl_backend.cc @@ -431,6 +431,12 @@ static void detect_workarounds() /* Minimum Per-Vertex stride is 1 byte for OpenGL. */ GCaps.minimum_per_vertex_stride = 1; + /* Force disable per feature. */ + if (G.debug & G_DEBUG_GPU_FORCE_DISABLE_SSBO) { + printf("\n"); + printf("GL: Force disabling SSBO support from commandline arguments.\n"); + GCaps.shader_storage_buffer_objects_support = false; + } } // namespace blender::gpu /** Internal capabilities. */ diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index fe2e14e0367..e0fea8a4686 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -579,6 +579,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo BLI_args_print_arg_doc(ba, "--debug-wintab"); 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"); BLI_args_print_arg_doc(ba, "--debug-wm"); # ifdef WITH_XR_OPENXR BLI_args_print_arg_doc(ba, "--debug-xr"); @@ -990,6 +991,9 @@ static const char arg_handle_debug_mode_generic_set_doc_depsgraph_uuid[] = static const char arg_handle_debug_mode_generic_set_doc_gpu_force_workarounds[] = "\n\t" "Enable workarounds for typical GPU issues and disable all GPU extensions."; +static const char arg_handle_debug_mode_generic_set_doc_gpu_disable_ssbo[] = + "\n\t" + "Disable usage of shader storage buffer objects."; static int arg_handle_debug_mode_generic_set(int UNUSED(argc), const char **UNUSED(argv), @@ -2212,6 +2216,11 @@ void main_args_setup(bContext *C, bArgs *ba) "--debug-gpu-force-workarounds", CB_EX(arg_handle_debug_mode_generic_set, gpu_force_workarounds), (void *)G_DEBUG_GPU_FORCE_WORKAROUNDS); + BLI_args_add(ba, + NULL, + "--debug-gpu-disable-ssbo", + CB_EX(arg_handle_debug_mode_generic_set, gpu_disable_ssbo), + (void *)G_DEBUG_GPU_FORCE_DISABLE_SSBO); BLI_args_add(ba, NULL, "--debug-exit-on-error", CB(arg_handle_debug_exit_on_error), NULL); BLI_args_add(ba, NULL, "--verbose", CB(arg_handle_verbosity_set), NULL);