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-02-01 10:38:34 +0300
committerJeroen Bakker <jeroen@blender.org>2022-02-01 10:38:34 +0300
commit146618fb221ebe1f008a0dd1ed05a0fc5ba935da (patch)
tree2b42be526f1e4e84fbc8351f022968c6791a6528 /source/blender/draw
parentc8814fb6103f2e028c857872f4f0eb613ef75db9 (diff)
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}.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/CMakeLists.txt1
-rw-r--r--source/blender/draw/intern/draw_manager_shader.c13
2 files changed, 9 insertions, 5 deletions
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;