[Bf-blender-cvs] [146618fb221] blender-v3.1-release: Fix T95376: Fix crash when switching to UV workspace.

Jeroen Bakker noreply at git.blender.org
Tue Feb 1 08:45:29 CET 2022


Commit: 146618fb221ebe1f008a0dd1ed05a0fc5ba935da
Author: Jeroen Bakker
Date:   Tue Feb 1 08:38:34 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rB146618fb221ebe1f008a0dd1ed05a0fc5ba935da

Fix T95376: Fix crash when switching to UV workspace.

Can also happen in other places when the overlay engine is active. Some
parts of the overlay engine uses builtin shaders, but disable the color
space conversion to the target texture.

Currently there the overlay engine has its own set of libraries it could
include and defined a macro to pass-throught the color space conversion.

The library include mechanism currently fails when it couldn't find the
builtin library in the libraries of the overlay engine. This only
happened in debug mode.

This change will not fail, but warns the developer if a library could
not be included. In the future this should be replaced by a different
mechanism that can disable the builtin library. See {T95382}.

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

M	source/blender/draw/CMakeLists.txt
M	source/blender/draw/intern/draw_manager_shader.c

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

diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt
index 3c25252efe8..47d99963ef9 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -45,6 +45,7 @@ set(INC
   ../../../intern/glew-mx
   ../../../intern/guardedalloc
   ../../../intern/opensubdiv
+  ../../../intern/clog
 
   # dna_type_offsets.h
   ${CMAKE_CURRENT_BINARY_DIR}/../makesdna/intern
diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c
index f8e64041a92..4715bd62779 100644
--- a/source/blender/draw/intern/draw_manager_shader.c
+++ b/source/blender/draw/intern/draw_manager_shader.c
@@ -46,6 +46,10 @@
 
 #include "draw_manager.h"
 
+#include "CLG_log.h"
+
+static CLG_LogRef LOG = {"draw.manager.shader"};
+
 extern char datatoc_gpu_shader_2D_vert_glsl[];
 extern char datatoc_gpu_shader_3D_vert_glsl[];
 extern char datatoc_gpu_shader_depth_only_frag_glsl[];
@@ -616,11 +620,10 @@ static uint32_t drw_shader_dependencies_get(const DRWShaderLibrary *lib, const c
       }
       dbg_name[i + 1] = '\0';
 
-      printf(
-          "Error: Dependency not found: %s\n"
-          "This might be due to bad lib ordering.\n",
-          dbg_name);
-      BLI_assert(0);
+      CLOG_WARN(&LOG,
+                "Error: Dependency not found: %s\n"
+                "This might be due to bad lib ordering or overriding a builtin shader.\n",
+                dbg_name);
     }
     else {
       deps |= 1u << (uint32_t)dep;



More information about the Bf-blender-cvs mailing list