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}.
This commit is contained in:
Jeroen Bakker 2022-02-01 08:38:34 +01:00
parent c8814fb610
commit 146618fb22
Notes: blender-bot 2023-02-14 09:36:46 +01:00
Referenced by issue #95376, When switching to UV workspace blender crashes with Error: Dependency not found: gpu_shader_colorspace_lib.glsl
2 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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;