[Bf-blender-cvs] [1fa527bfa3a] blender2.8: BKE: Add "--debug-gpu-force-workarounds" to force gpu workarounds

Clément Foucault noreply at git.blender.org
Wed Dec 5 03:05:48 CET 2018


Commit: 1fa527bfa3a6f78e9f00a21649f396d21344420e
Author: Clément Foucault
Date:   Wed Dec 5 03:05:39 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB1fa527bfa3a6f78e9f00a21649f396d21344420e

BKE: Add "--debug-gpu-force-workarounds" to force gpu workarounds

This is nice to test workarounds on other configs that may benefits from
the existing workarounds.

===================================================================

M	source/blender/blenkernel/BKE_global.h
M	source/blender/gpu/intern/gpu_extensions.c
M	source/creator/creator_args.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 9a6560238ea..b2991679775 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -143,6 +143,7 @@ enum {
 	G_DEBUG_GPU =       (1 << 16),  /* gpu debug */
 	G_DEBUG_IO =        (1 << 17),  /* IO Debugging (for Collada, ...)*/
 	G_DEBUG_GPU_SHADERS = (1 << 18),  /* GLSL shaders */
+	G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 19),  /* force gpu workarounds bypassing detections. */
 };
 
 #define G_DEBUG_ALL  (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 92d91bd440d..2309c6dc009 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -343,6 +343,12 @@ void gpu_extensions_init(void)
 
 	gpu_detect_mip_render_workaround();
 
+	if (G.debug & G_DEBUG_GPU_FORCE_WORKAROUNDS) {
+		GG.mip_render_workaround = true;
+		GG.depth_blitting_workaround = true;
+		GG.unused_fb_slot_workaround = true;
+	}
+
 	/* df/dy calculation factors, those are dependent on driver */
 	if ((strstr(vendor, "ATI") && strstr(version, "3.3.10750"))) {
 		GG.dfdyfactors[0] = 1.0;
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 12d8cd1d5b8..5b976515dd8 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -1933,6 +1933,8 @@ void main_args_setup(bContext *C, bArgs *ba)
 	            CB_EX(arg_handle_debug_mode_generic_set, gpumem), (void *)G_DEBUG_GPU_MEM);
 	BLI_argsAdd(ba, 1, NULL, "--debug-gpu-shaders",
 	            CB_EX(arg_handle_debug_mode_generic_set, gpumem), (void *)G_DEBUG_GPU_SHADERS);
+	BLI_argsAdd(ba, 1, NULL, "--debug-gpu-force-workarounds",
+	            CB_EX(arg_handle_debug_mode_generic_set, gpumem), (void *)G_DEBUG_GPU_FORCE_WORKAROUNDS);
 
 	BLI_argsAdd(ba, 1, NULL, "--verbose", CB(arg_handle_verbosity_set), NULL);



More information about the Bf-blender-cvs mailing list