diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-02-01 13:04:38 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-02-01 13:04:38 +0300 |
commit | 34449ba9a68a6ca5bbd366d199d4a3aac9ebc073 (patch) | |
tree | a8e3123518dc7ac79197ea032fc561d8b2409d7f | |
parent | 120deaac5babbce9625541f470ce3e4d5363c996 (diff) | |
parent | 6f9828289f397228c6cab6f352fb4a84a65da22a (diff) |
Merge branch 'blender-v3.1-release'
8 files changed, 27 insertions, 9 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 4bc9e0d2d14..6614509f860 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -284,6 +284,7 @@ void depsgraph_tag_component(Depsgraph *graph, * here. */ if (component_node == nullptr) { if (component_type == NodeType::ANIMATION) { + id_node->is_cow_explicitly_tagged = true; depsgraph_id_tag_copy_on_write(graph, id_node, update_source); } return; @@ -301,6 +302,9 @@ void depsgraph_tag_component(Depsgraph *graph, if (component_node->need_tag_cow_before_update()) { depsgraph_id_tag_copy_on_write(graph, id_node, update_source); } + if (component_type == NodeType::COPY_ON_WRITE) { + id_node->is_cow_explicitly_tagged = true; + } } /* This is a tag compatibility with legacy code. @@ -888,6 +892,7 @@ void DEG_ids_clear_recalc(Depsgraph *depsgraph, const bool backup) * correctly when there are multiple depsgraph with others still using * the recalc flag. */ id_node->is_user_modified = false; + id_node->is_cow_explicitly_tagged = false; deg_graph_clear_id_recalc_flags(id_node->id_cow); if (deg_graph->is_active) { deg_graph_clear_id_recalc_flags(id_node->id_orig); diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 851d0bcf000..8a3c5c5b776 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -904,7 +904,7 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDNode * modifiers. * * TODO: Investigate modes besides edit-mode. */ - if (check_datablock_expanded(id_cow)) { + if (check_datablock_expanded(id_cow) && !id_node->is_cow_explicitly_tagged) { const ID_Type id_type = GS(id_orig->name); if (OB_DATA_SUPPORT_EDITMODE(id_type) && BKE_object_data_is_in_editmode(id_orig)) { /* Make sure pointers in the edit mode data are updated in the copy. diff --git a/source/blender/depsgraph/intern/node/deg_node_id.h b/source/blender/depsgraph/intern/node/deg_node_id.h index 257e42b8e67..f18c44b6332 100644 --- a/source/blender/depsgraph/intern/node/deg_node_id.h +++ b/source/blender/depsgraph/intern/node/deg_node_id.h @@ -121,6 +121,9 @@ struct IDNode : public Node { /* Accumulated flag from operation. Is initialized and used during updates flush. */ bool is_user_modified; + /* Copy-on-Write component has been explicitly tagged for update. */ + bool is_cow_explicitly_tagged; + /* Accumulate recalc flags from multiple update passes. */ int id_cow_recalc_backup; 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/engines/image/image_private.hh b/source/blender/draw/engines/image/image_private.hh index d8f8adb7e84..d586515c6be 100644 --- a/source/blender/draw/engines/image/image_private.hh +++ b/source/blender/draw/engines/image/image_private.hh @@ -54,6 +54,8 @@ struct IMAGE_Data { #define IMAGE_DRAW_FLAG_APPLY_ALPHA (1 << 1) #define IMAGE_DRAW_FLAG_SHUFFLING (1 << 2) #define IMAGE_DRAW_FLAG_DEPTH (1 << 3) +/** Flag to disable depth testing (used for node editor back drop drawing).*/ +#define IMAGE_DRAW_FLAG_DEPTH_ALWAYS (1 << 4) /** * Abstract class for a drawing mode of the image engine. diff --git a/source/blender/draw/engines/image/image_space_node.hh b/source/blender/draw/engines/image/image_space_node.hh index 15eef8f6499..b0da3d1055b 100644 --- a/source/blender/draw/engines/image/image_space_node.hh +++ b/source/blender/draw/engines/image/image_space_node.hh @@ -56,6 +56,7 @@ class SpaceNodeAccessor : public AbstractSpaceAccessor { void get_shader_parameters(ShaderParameters &r_shader_parameters, ImBuf *ibuf) override { + r_shader_parameters.flags |= IMAGE_DRAW_FLAG_DEPTH_ALWAYS; if ((snode->flag & SNODE_USE_ALPHA) != 0) { /* Show RGBA */ r_shader_parameters.flags |= IMAGE_DRAW_FLAG_SHOW_ALPHA | IMAGE_DRAW_FLAG_APPLY_ALPHA; diff --git a/source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl b/source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl index 0edc18836f0..65fd4833b23 100644 --- a/source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl +++ b/source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl @@ -5,6 +5,7 @@ #define IMAGE_DRAW_FLAG_APPLY_ALPHA (1 << 1) #define IMAGE_DRAW_FLAG_SHUFFLING (1 << 2) #define IMAGE_DRAW_FLAG_DEPTH (1 << 3) +#define IMAGE_DRAW_FLAG_DEPTH_ALWAYS (1 << 4) #define FAR_DISTANCE farNearDistances.x #define NEAR_DISTANCE farNearDistances.y @@ -12,9 +13,11 @@ void main() { ivec2 uvs_clamped = ivec2(uv_screen); - float depth = texelFetch(depth_texture, uvs_clamped, 0).r; - if (depth == 1.0) { - discard; + if ((drawFlags & IMAGE_DRAW_FLAG_DEPTH_ALWAYS) == 0) { + float depth = texelFetch(depth_texture, uvs_clamped, 0).r; + if (depth == 1.0) { + discard; + } } vec4 tex_color = texelFetch(imageTexture, uvs_clamped, 0); 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; |