BKE: Add "--debug-gpu-force-workarounds" to force gpu workarounds
authorClément Foucault <foucault.clem@gmail.com>
Wed, 5 Dec 2018 02:05:39 +0000 (03:05 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 5 Dec 2018 02:05:39 +0000 (03:05 +0100)
This is nice to test workarounds on other configs that may benefits from
the existing workarounds.

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

index 9a6560238ea739701daf15942ceca4822aa2f5be..b29916797757af046f449f5534c9868fa9b0b240 100644 (file)
@@ -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 | \
index 92d91bd440d50c3d6450d867ce90380079b3eb72..2309c6dc00936beae7cb0e7242fcae2a7e2f191f 100644 (file)
@@ -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;
index 12d8cd1d5b872d9b6dbe2eac42b85ee54324ec32..5b976515dd8fe16231e3460ff94427b9eb658ca5 100644 (file)
@@ -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);