Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2022-09-26 10:41:50 +0300
committerJeroen Bakker <jeroen@blender.org>2022-09-26 10:41:50 +0300
commit0210c4df1793799a09a35e44be286dfca88769dc (patch)
tree23d7ce3f97d9692d7da48dc8098c303856b13e74
parent6075b04cf970d7ae2d7a7be0e0180ccaedfe83cf (diff)
GPU: Disable SSBO support from commandline.
In heavy scenes containing many hairs/curves and volumetrics using SSBO can overwrite the binding information of the volumetric resolve shader. This has been detected during project Heist and is only reproducable on NVIDIA platform. This patch adds an debug option to disable SSBOs from the command line to replace the --debug-gpu-force-workarounds that has been used as a workaround on the render farm. Reason is that force workarounds will also add other limitations as well (number of texture binds for example)
-rw-r--r--source/blender/blenkernel/BKE_global.h19
-rw-r--r--source/blender/gpu/opengl/gl_backend.cc6
-rw-r--r--source/creator/creator_args.c9
3 files changed, 25 insertions, 9 deletions
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_GHOST = (1 << 21), /* Debug GHOST module. */
- G_DEBUG_WINTAB = (1 << 22), /* Debug Wintab. */
+ 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 << 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);