[Bf-blender-cvs] [b015fc4247a] master: Cleanup: Use single declaration of TileNumber.
Commit: b015fc4247af95a2fb4f0d77d5e37aa96d88e10a Author: Jeroen Bakker Date: Wed Dec 21 08:42:19 2022 +0100 Branches: master https://developer.blender.org/rBb015fc4247af95a2fb4f0d77d5e37aa96d88e10a Cleanup: Use single declaration of TileNumber. We used int and int32_t. === M source/blender/blenkernel/BKE_image_partial_update.hh M source/blender/blenkernel/BKE_image_wrappers.hh M source/blender/blenkernel/intern/image_partial_update.cc === diff --git a/source/blender/blenkernel/BKE_image_partial_update.hh b/source/blender/blenkernel/BKE_image_partial_update.hh index b9b748880bb..6c7776c091c 100644 --- a/source/blender/blenkernel/BKE_image_partial_update.hh +++ b/source/blender/blenkernel/BKE_image_partial_update.hh @@ -18,6 +18,8 @@ #include "BLI_rect.h" +#include "BKE_image_wrappers.hh" + #include "DNA_image_types.h" extern "C" { @@ -27,7 +29,6 @@ struct PartialUpdateUser; namespace blender::bke::image { -using TileNumber = int; namespace partial_update { diff --git a/source/blender/blenkernel/BKE_image_wrappers.hh b/source/blender/blenkernel/BKE_image_wrappers.hh index 344edd952f8..b3e81571e05 100644 --- a/source/blender/blenkernel/BKE_image_wrappers.hh +++ b/source/blender/blenkernel/BKE_image_wrappers.hh @@ -13,13 +13,16 @@ namespace blender::bke::image { +/** Type to use for UDIM tile numbers (1001). */ +using TileNumber = int32_t; + struct ImageTileWrapper { ImageTile *image_tile; ImageTileWrapper(ImageTile *image_tile) : image_tile(image_tile) { } - int get_tile_number() const + TileNumber get_tile_number() const { return image_tile->tile_number; } @@ -31,13 +34,13 @@ struct ImageTileWrapper { int get_tile_x_offset() const { -int tile_number = get_tile_number(); +TileNumber tile_number = get_tile_number(); return (tile_number - 1001) % 10; } int get_tile_y_offset() const { -int tile_number = get_tile_number(); +TileNumber tile_number = get_tile_number(); return (tile_number - 1001) / 10; } }; diff --git a/source/blender/blenkernel/intern/image_partial_update.cc b/source/blender/blenkernel/intern/image_partial_update.cc index 6ffd323cc1e..ecf55d6b694 100644 --- a/source/blender/blenkernel/intern/image_partial_update.cc +++ b/source/blender/blenkernel/intern/image_partial_update.cc @@ -125,7 +125,6 @@ static PartialUpdateRegisterImpl *unwrap(struct PartialUpdateRegister *partial_u return static_cast(static_cast(partial_update_register)); } -using TileNumber = int32_t; using ChangesetID = int64_t; constexpr ChangesetID UnknownChangesetID = -1; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fd9a1d62f59] master: install_deps: Enable building OIIO tools.
Commit: fd9a1d62f592a2ed104b8949ce5122d85d295603 Author: Bastien Montagne Date: Wed Dec 21 15:58:03 2022 +0900 Branches: master https://developer.blender.org/rBfd9a1d62f592a2ed104b8949ce5122d85d295603 install_deps: Enable building OIIO tools. These tools are needed by some unittests doing image comparison e.g. === M build_files/build_environment/install_deps.sh === diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index c7b4c5930af..ed18e563f14 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -2243,7 +2243,7 @@ compile_OIIO() { fi # To be changed each time we make edits that would modify the compiled result! - oiio_magic=18 + oiio_magic=19 _init_oiio # Force having own builds for the dependencies. @@ -2323,7 +2323,7 @@ compile_OIIO() { cmake_d="$cmake_d -D USE_OPENVDB=OFF" cmake_d="$cmake_d -D BUILD_TESTING=OFF" cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF" -cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF" +cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=ON" cmake_d="$cmake_d -D TXT2MAN=" #cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON" #cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fcddb7cda76] master: Small refactor of some of the RNA diffing API.
Commit: fcddb7cda7668ca36bb29a4256a31624ff00b645 Author: Bastien Montagne Date: Tue Dec 20 23:36:29 2022 +0900 Branches: master https://developer.blender.org/rBfcddb7cda7668ca36bb29a4256a31624ff00b645 Small refactor of some of the RNA diffing API. Propagate `eRNAOverrideMatchResult` 'return' flags at higher level into BKE API, instead of just returning a boolean true when new override rules have been created. NOTE: This is an intermediary step towards fixing T102766. Differential Revision: https://developer.blender.org/D16761 === M source/blender/blenkernel/BKE_lib_override.h M source/blender/blenkernel/intern/blendfile.c M source/blender/blenkernel/intern/blendfile_link_append.c M source/blender/blenkernel/intern/lib_override.cc M source/blender/blenkernel/intern/undo_system.c M source/blender/makesrna/RNA_access.h M source/blender/makesrna/intern/rna_ID.c M source/blender/windowmanager/intern/wm_files.c === diff --git a/source/blender/blenkernel/BKE_lib_override.h b/source/blender/blenkernel/BKE_lib_override.h index 963e2d09b17..a98984250b9 100644 --- a/source/blender/blenkernel/BKE_lib_override.h +++ b/source/blender/blenkernel/BKE_lib_override.h @@ -401,6 +401,8 @@ bool BKE_lib_override_library_status_check_reference(struct Main *bmain, struct * Compare local and reference data-blocks and create new override operations as needed, * or reset to reference values if overriding is not allowed. * + * \param r_report_flags #eRNAOverrideMatchResult flags giving info about the result of this call. + * * \note Defining override operations is only mandatory before saving a `.blend` file on disk * (not for undo!). * Knowing that info at runtime is only useful for UI/UX feedback. @@ -411,11 +413,17 @@ bool BKE_lib_override_library_status_check_reference(struct Main *bmain, struct * * \return true if any library operation was created. */ -bool BKE_lib_override_library_operations_create(struct Main *bmain, struct ID *local); +void BKE_lib_override_library_operations_create(struct Main *bmain, +struct ID *local, +int *r_report_flags); /** * Check all overrides from given \a bmain and create/update overriding operations as needed. + * + * \param r_report_flags #eRNAOverrideMatchResult flags giving info about the result of this call. */ -bool BKE_lib_override_library_main_operations_create(struct Main *bmain, bool force_auto); +void BKE_lib_override_library_main_operations_create(struct Main *bmain, + bool force_auto, + int *r_report_flags); /** * Reset all overrides in given \a id_root, while preserving ID relations. diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index fb50de47881..7aa3fd4b9c5 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -435,7 +435,7 @@ static void setup_app_data(bContext *C, reports->duration.lib_overrides_resync; /* We need to rebuild some of the deleted override rules (for UI feedback purpose). */ -BKE_lib_override_library_main_operations_create(bmain, true); +BKE_lib_override_library_main_operations_create(bmain, true, NULL); } } diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c index 409ae39f6be..3f3c1028d10 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.c +++ b/source/blender/blenkernel/intern/blendfile_link_append.c @@ -1424,7 +1424,7 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, /* All override rules need to be up to date, since there will be no do_version here, otherwise * older, now-invalid rules might be applied and likely fail, or some changes might be missing, * etc. See T93353. */ - BKE_lib_override_library_main_operations_create(bmain, true); + BKE_lib_override_library_main_operations_create(bmain, true, NULL); /* Remove all IDs to be reloaded from Main. */ lba_idx = set_listbasepointers(bmain, lbarray); @@ -1634,7 +1634,7 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, .reports = reports, }); /* We need to rebuild some of the deleted override rules (for UI feedback purpose). */ -BKE_lib_override_library_main_operations_create(bmain, true); +BKE_lib_override_library_main_operations_create(bmain, true, NULL); } BKE_main_collection_sync(bmain); diff --git a/source/blender/blenkernel
[Bf-blender-cvs] [4c295276f00] master: Cycles: Fix Metal kernel compilation
Commit: 4c295276f001ff9729496fe024ddf96d5ab51d31 Author: Lukas Stockner Date: Wed Dec 21 04:24:22 2022 +0100 Branches: master https://developer.blender.org/rB4c295276f001ff9729496fe024ddf96d5ab51d31 Cycles: Fix Metal kernel compilation === M intern/cycles/kernel/integrator/init_from_bake.h === diff --git a/intern/cycles/kernel/integrator/init_from_bake.h b/intern/cycles/kernel/integrator/init_from_bake.h index 308f708380f..0d25c6493fe 100644 --- a/intern/cycles/kernel/integrator/init_from_bake.h +++ b/intern/cycles/kernel/integrator/init_from_bake.h @@ -27,8 +27,8 @@ CCL_NAMESPACE_BEGIN * For triangles that are smaller than a texel, this might take too many attempts, so eventually * we just give up and don't jitter in that case. * This is not a particularly elegant solution, but it's probably the best we can do. */ -ccl_device_inline void bake_jitter_barycentric(float &u, - float &v, +ccl_device_inline void bake_jitter_barycentric(ccl_private float &u, + ccl_private float &v, float2 rand_filter, const float dudx, const float dudy, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [40e5954e396] master: Cleanup: Use ampersand instead of "and" for labels
Commit: 40e5954e3967140644e974e51ee729da5891be0e Author: Aaron Carlisle Date: Tue Dec 13 23:24:15 2022 -0500 Branches: master https://developer.blender.org/rB40e5954e3967140644e974e51ee729da5891be0e Cleanup: Use ampersand instead of "and" for labels UI guideline is use '&' for labels, use "and" for descriptions. === M source/blender/makesrna/intern/rna_modifier.c === diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index d1e5fc913eb..24db2136af9 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -6951,7 +6951,7 @@ static void rna_def_modifier_weightednormal(BlenderRNA *brna) {MOD_WEIGHTEDNORMAL_MODE_FACE_ANGLE, "FACE_AREA_WITH_ANGLE", 0, - "Face Area And Angle", + "Face Area & Angle", "Generated normals weighted by both face area and angle"}, {0, NULL, 0, NULL, NULL}, }; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fb7f12dc407] master: Cleanup: hide 'UNUSED' macro definition for C++
Commit: fb7f12dc40780106fb159786fd3064bf80432a17 Author: Germano Cavalcante Date: Tue Dec 20 15:51:47 2022 -0300 Branches: master https://developer.blender.org/rBfb7f12dc40780106fb159786fd3064bf80432a17 Cleanup: hide 'UNUSED' macro definition for C++ This may allow the `C4100` warning to be re-enabled in the MSVC for C++. Differential Revision: https://developer.blender.org/D16828 === M source/blender/blenkernel/BKE_ccg.h M source/blender/blenkernel/intern/cloth.cc M source/blender/blenkernel/intern/data_transfer.cc M source/blender/blenkernel/intern/key.cc M source/blender/blenkernel/intern/layer.cc M source/blender/blenkernel/intern/linestyle.cc M source/blender/blenkernel/intern/material.cc M source/blender/blenkernel/intern/texture.cc M source/blender/blenlib/BLI_utildefines.h M source/blender/bmesh/intern/bmesh_mesh_normals.cc M source/blender/compositor/intern/COM_MetaData.h M source/blender/draw/engines/eevee/eevee_shaders.cc M source/blender/draw/engines/image/image_space_image.hh M source/blender/draw/intern/draw_cache_impl_curves.cc M source/blender/draw/intern/draw_cache_impl_gpencil.cc M source/blender/editors/geometry/geometry_attributes.cc M source/blender/editors/interface/interface_context_menu.cc M source/blender/editors/interface/interface_icons.cc M source/blender/editors/sculpt_paint/paint_cursor.cc M source/blender/editors/sculpt_paint/paint_image_proj.cc M source/blender/editors/space_buttons/buttons_texture.cc M source/blender/editors/space_clip/tracking_ops_orient.cc M source/blender/editors/transform/transform_snap.cc M source/blender/gpu/intern/gpu_codegen.cc M source/blender/modifiers/intern/MOD_displace.cc M source/blender/modifiers/intern/MOD_triangulate.cc M source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc M source/blender/nodes/intern/node_util.cc M source/blender/nodes/texture/node_texture_tree.cc M source/blender/nodes/texture/node_texture_util.cc M source/blender/nodes/texture/nodes/node_texture_at.cc M source/blender/nodes/texture/nodes/node_texture_bricks.cc M source/blender/nodes/texture/nodes/node_texture_checker.cc M source/blender/nodes/texture/nodes/node_texture_combine_color.cc M source/blender/nodes/texture/nodes/node_texture_compose.cc M source/blender/nodes/texture/nodes/node_texture_coord.cc M source/blender/nodes/texture/nodes/node_texture_curves.cc M source/blender/nodes/texture/nodes/node_texture_decompose.cc M source/blender/nodes/texture/nodes/node_texture_distance.cc M source/blender/nodes/texture/nodes/node_texture_hueSatVal.cc M source/blender/nodes/texture/nodes/node_texture_image.cc M source/blender/nodes/texture/nodes/node_texture_invert.cc M source/blender/nodes/texture/nodes/node_texture_math.cc M source/blender/nodes/texture/nodes/node_texture_mixRgb.cc M source/blender/nodes/texture/nodes/node_texture_output.cc M source/blender/nodes/texture/nodes/node_texture_proc.cc M source/blender/nodes/texture/nodes/node_texture_rotate.cc M source/blender/nodes/texture/nodes/node_texture_scale.cc M source/blender/nodes/texture/nodes/node_texture_separate_color.cc M source/blender/nodes/texture/nodes/node_texture_texture.cc M source/blender/nodes/texture/nodes/node_texture_translate.cc M source/blender/nodes/texture/nodes/node_texture_valToNor.cc M source/blender/nodes/texture/nodes/node_texture_valToRgb.cc M source/blender/nodes/texture/nodes/node_texture_viewer.cc M source/blender/render/intern/engine.cc M source/blender/render/intern/multires_bake.cc === diff --git a/source/blender/blenkernel/BKE_ccg.h b/source/blender/blenkernel/BKE_ccg.h index 786b84a0469..64b9870a8ea 100644 --- a/source/blender/blenkernel/BKE_ccg.h +++ b/source/blender/blenkernel/BKE_ccg.h @@ -83,7 +83,12 @@ BLI_INLINE CCGElem *CCG_elem_next(const CCGKey *key, CCGElem *elem); /* inline definitions follow */ -BLI_INLINE float *CCG_elem_co(const CCGKey *UNUSED(key), CCGElem *elem) +BLI_INLINE float *CCG_elem_co(const CCGKey * +#ifndef __cplusplus + UNUSED(key) +#endif + , + CCGElem *elem) { return (float *)elem; } diff --git a/source/blender/blenkernel/intern/cloth.cc b/source/blender/blenkernel/intern/cloth.cc index ecd21dcb570..73cf7e1f805 100644 --- a/source/blender/blenkernel/intern/cloth.cc +++ b/source/blender/blenkernel/intern/cloth.cc @@ -713,7 +713,7 @@ static float cloth_shrink_factor(ClothModifierData *clmd, ClothVertex *verts, in } static bool cloth_from_object( -Object *ob, Cloth
[Bf-blender-cvs] [e4139476bf7] temp-nodes-group-declarations: Merge branch 'master' into temp-nodes-group-declarations
Commit: e4139476bf7a5b702b60fedb23e2f5075d70ce9e Author: Hans Goudey Date: Tue Dec 20 14:50:24 2022 -0600 Branches: temp-nodes-group-declarations https://developer.blender.org/rBe4139476bf7a5b702b60fedb23e2f5075d70ce9e Merge branch 'master' into temp-nodes-group-declarations === === diff --cc source/blender/blenkernel/intern/node_tree_field_inferencing.cc index 2ca30286cd5,5c527e29131..879dafd9d7d --- a/source/blender/blenkernel/intern/node_tree_field_inferencing.cc +++ b/source/blender/blenkernel/intern/node_tree_field_inferencing.cc @@@ -486,30 -496,43 +496,47 @@@ static void update_socket_shapes(const } } + static void prepare_inferencing_interfaces( + const Span nodes, + MutableSpan interface_by_node, + ResourceScope &scope) + { + for (const int i : nodes.index_range()) { + interface_by_node[i] = &get_node_field_inferencing_interface(*nodes[i], scope); + } + } + -bool update_field_inferencing(const bNodeTree &tree) +void calculate_field_interface(const bNodeTree &tree, FieldInferencingInterface &r_interface) { tree.ensure_topology_cache(); + const Span nodes = tree.all_nodes(); + ResourceScope scope; + Array interface_by_node(nodes.size()); + prepare_inferencing_interfaces(nodes, interface_by_node, scope); + + /* Create new inferencing interface for this node group. */ - std::unique_ptr new_inferencing_interface = - std::make_unique(); - new_inferencing_interface->inputs.resize(BLI_listbase_count(&tree.inputs), - InputSocketFieldType::IsSupported); - new_inferencing_interface->outputs.resize(BLI_listbase_count(&tree.outputs), - OutputFieldDependency::ForDataSource()); + r_interface.inputs.resize(BLI_listbase_count(&tree.inputs), InputSocketFieldType::IsSupported); + r_interface.outputs.resize(BLI_listbase_count(&tree.outputs), + OutputFieldDependency::ForDataSource()); /* Keep track of the state of all sockets. The index into this array is #SocketRef::id(). */ Array field_state_by_socket_id(tree.all_sockets().size()); - propagate_data_requirements_from_right_to_left(tree, field_state_by_socket_id); + propagate_data_requirements_from_right_to_left( + tree, interface_by_node, field_state_by_socket_id); - determine_group_input_states(tree, *new_inferencing_interface, field_state_by_socket_id); + determine_group_input_states(tree, r_interface, field_state_by_socket_id); - propagate_field_status_from_left_to_right(tree, field_state_by_socket_id); - determine_group_output_states(tree, r_interface, field_state_by_socket_id); + propagate_field_status_from_left_to_right(tree, interface_by_node, field_state_by_socket_id); - determine_group_output_states( - tree, *new_inferencing_interface, interface_by_node, field_state_by_socket_id); ++ determine_group_output_states(tree, r_interface, interface_by_node, field_state_by_socket_id); update_socket_shapes(tree, field_state_by_socket_id); +} + +bool update_field_inferencing(const bNodeTree &tree) +{ + /* Create new inferencing interface for this node group. */ + std::unique_ptr new_inferencing_interface = + std::make_unique(); + calculate_field_interface(tree, *new_inferencing_interface); /* Update the previous group interface. */ const bool group_interface_changed = !tree.runtime->field_inferencing_interface || ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6383ed9956c] master: Fix: Assert failure in mirror modifier
Commit: 6383ed9956cc661cff0ecb16d37e042503b66bfa Author: Hans Goudey Date: Tue Dec 20 14:07:14 2022 -0600 Branches: master https://developer.blender.org/rB6383ed9956cc661cff0ecb16d37e042503b66bfa Fix: Assert failure in mirror modifier This was harmless because the function would just return null in release builds, which was checked. Theoretically this vertex group mapping shouldn't depend on the object type, but the vertex group API would have to move away from the object-level first. === M source/blender/blenkernel/intern/mesh_mirror.cc === diff --git a/source/blender/blenkernel/intern/mesh_mirror.cc b/source/blender/blenkernel/intern/mesh_mirror.cc index 8830139a697..26a84d4d2b9 100644 --- a/source/blender/blenkernel/intern/mesh_mirror.cc +++ b/source/blender/blenkernel/intern/mesh_mirror.cc @@ -445,27 +445,27 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, } /* handle vgroup stuff */ - if ((mmd->flag & MOD_MIR_VGROUP) && CustomData_has_layer(&result->vdata, CD_MDEFORMVERT)) { -MDeformVert *dvert = BKE_mesh_deform_verts_for_write(result) + maxVerts; -int *flip_map = nullptr, flip_map_len = 0; - -flip_map = BKE_object_defgroup_flip_map(ob, false, &flip_map_len); - -if (flip_map) { - for (i = 0; i < maxVerts; dvert++, i++) { -/* merged vertices get both groups, others get flipped */ -if (use_correct_order_on_merge && do_vtargetmap && (vtargetmap[i + maxVerts] != -1)) { - BKE_defvert_flip_merged(dvert - maxVerts, flip_map, flip_map_len); -} -else if (!use_correct_order_on_merge && do_vtargetmap && (vtargetmap[i] != -1)) { - BKE_defvert_flip_merged(dvert, flip_map, flip_map_len); -} -else { - BKE_defvert_flip(dvert, flip_map, flip_map_len); + if (BKE_object_supports_vertex_groups(ob)) { +if ((mmd->flag & MOD_MIR_VGROUP) && CustomData_has_layer(&result->vdata, CD_MDEFORMVERT)) { + MDeformVert *dvert = BKE_mesh_deform_verts_for_write(result) + maxVerts; + int flip_map_len = 0; + int *flip_map = BKE_object_defgroup_flip_map(ob, false, &flip_map_len); + if (flip_map) { +for (i = 0; i < maxVerts; dvert++, i++) { + /* merged vertices get both groups, others get flipped */ + if (use_correct_order_on_merge && do_vtargetmap && (vtargetmap[i + maxVerts] != -1)) { +BKE_defvert_flip_merged(dvert - maxVerts, flip_map, flip_map_len); + } + else if (!use_correct_order_on_merge && do_vtargetmap && (vtargetmap[i] != -1)) { +BKE_defvert_flip_merged(dvert, flip_map, flip_map_len); + } + else { +BKE_defvert_flip(dvert, flip_map, flip_map_len); + } } - } - MEM_freeN(flip_map); +MEM_freeN(flip_map); + } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d6931fd5aec] refactor-mesh-corners-generic: Small cleanup to mesh convert
Commit: d6931fd5aec4897c80f755fe48143403fcc5ad1e Author: Hans Goudey Date: Tue Dec 20 13:55:05 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rBd6931fd5aec4897c80f755fe48143403fcc5ad1e Small cleanup to mesh convert === M source/blender/blenkernel/intern/mesh_convert.cc === diff --git a/source/blender/blenkernel/intern/mesh_convert.cc b/source/blender/blenkernel/intern/mesh_convert.cc index 27db035a0c0..bf322bb9aeb 100644 --- a/source/blender/blenkernel/intern/mesh_convert.cc +++ b/source/blender/blenkernel/intern/mesh_convert.cc @@ -197,7 +197,6 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba MEdge *medge = edges.data(); MPoly *mpoly = polys.data(); - int *corner_vert = corner_verts.data(); MutableAttributeAccessor attributes = mesh->attributes_for_write(); SpanAttributeWriter material_indices = attributes.lookup_or_add_for_write_only_span( "material_index", ATTR_DOMAIN_FACE); @@ -205,6 +204,7 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba &mesh->ldata, CD_MLOOPUV, CD_SET_DEFAULT, nullptr, mesh->totloop, DATA_("UVMap"))); /* verts and faces */ + int dst_corner_i = 0; vertcount = 0; LISTBASE_FOREACH (const DispList *, dl, dispbase) { @@ -271,16 +271,16 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba a = dl->parts; index = dl->index; while (a--) { -corner_vert[0] = startvert + index[0]; -corner_vert[1] = startvert + index[2]; -corner_vert[2] = startvert + index[1]; -mpoly->loopstart = int(corner_vert - corner_verts.data()); +corner_verts[dst_corner_i + 0] = startvert + index[0]; +corner_verts[dst_corner_i + 1] = startvert + index[2]; +corner_verts[dst_corner_i + 2] = startvert + index[1]; +mpoly->loopstart = dst_corner_i; mpoly->totloop = 3; material_indices.span[mpoly - polys.data()] = dl->col; if (mloopuv) { for (int i = 0; i < 3; i++, mloopuv++) { -mloopuv->uv[0] = (corner_vert[i] - startvert) / float(dl->nr - 1); +mloopuv->uv[0] = (corner_verts[dst_corner_i + i] - startvert) / float(dl->nr - 1); mloopuv->uv[1] = 0.0f; } } @@ -289,7 +289,7 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba mpoly->flag |= ME_SMOOTH; } mpoly++; -corner_vert += 3; +dst_corner_i += 3; index += 3; } } @@ -329,11 +329,11 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba } for (; b < dl->nr; b++) { - corner_vert[0] = p1; - corner_vert[1] = p3; - corner_vert[2] = p4; - corner_vert[3] = p2; - mpoly->loopstart = int(corner_vert - corner_verts.data()); + corner_verts[dst_corner_i + 0] = p1; + corner_verts[dst_corner_i + 1] = p3; + corner_verts[dst_corner_i + 2] = p4; + corner_verts[dst_corner_i + 3] = p2; + mpoly->loopstart = dst_corner_i; mpoly->totloop = 4; material_indices.span[mpoly - polys.data()] = dl->col; @@ -354,7 +354,7 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba for (int i = 0; i < 4; i++, mloopuv++) { /* find uv based on vertex index into grid array */ - int v = corner_vert[i] - startvert; + int v = corner_verts[dst_corner_i + i] - startvert; mloopuv->uv[0] = (v / dl->nr) / float(orco_sizev); mloopuv->uv[1] = (v % dl->nr) / float(orco_sizeu); @@ -373,7 +373,7 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba mpoly->flag |= ME_SMOOTH; } mpoly++; - corner_vert += 4; + dst_corner_i += 4; p4 = p3; p3++; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4f20b1e7ee5] refactor-mesh-corners-generic: Fix screw modifier
Commit: 4f20b1e7ee56bb25ca246142caf3a03572ab1c05 Author: Hans Goudey Date: Tue Dec 20 13:55:16 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rB4f20b1e7ee56bb25ca246142caf3a03572ab1c05 Fix screw modifier === M source/blender/modifiers/intern/MOD_screw.cc === diff --git a/source/blender/modifiers/intern/MOD_screw.cc b/source/blender/modifiers/intern/MOD_screw.cc index 576637b425e..21269df3ed0 100644 --- a/source/blender/modifiers/intern/MOD_screw.cc +++ b/source/blender/modifiers/intern/MOD_screw.cc @@ -932,16 +932,17 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * /* Loop-Data */ if (!(close && step == step_last)) { /* regular segments */ -corner_verts_new[quad_ord[0]] = int(i1); -corner_verts_new[quad_ord[1]] = int(i2); -corner_verts_new[quad_ord[2]] = int(i2 + totvert); -corner_verts_new[quad_ord[3]] = int(i1 + totvert); +corner_verts_new[new_loop_index + quad_ord[0]] = int(i1); +corner_verts_new[new_loop_index + quad_ord[1]] = int(i2); +corner_verts_new[new_loop_index + quad_ord[2]] = int(i2 + totvert); +corner_verts_new[new_loop_index + quad_ord[3]] = int(i1 + totvert); -corner_edges_new[quad_ord_ofs[0]] = int( +corner_edges_new[new_loop_index + quad_ord_ofs[0]] = int( step == 0 ? i : (edge_offset + step + (i * (step_tot - 1))) - 1); -corner_edges_new[quad_ord_ofs[1]] = int(totedge + i2); -corner_edges_new[quad_ord_ofs[2]] = int(edge_offset + step + (i * (step_tot - 1))); -corner_edges_new[quad_ord_ofs[3]] = int(totedge + i1); +corner_edges_new[new_loop_index + quad_ord_ofs[1]] = int(totedge + i2); +corner_edges_new[new_loop_index + quad_ord_ofs[2]] = int(edge_offset + step + + (i * (step_tot - 1))); +corner_edges_new[new_loop_index + quad_ord_ofs[3]] = int(totedge + i1); /* new vertical edge */ if (step) { /* The first set is already done */ @@ -955,15 +956,16 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * } else { /* last segment */ -corner_verts_new[quad_ord[0]] = int(i1); -corner_verts_new[quad_ord[1]] = int(i2); -corner_verts_new[quad_ord[2]] = int(med_new_firstloop->v2); -corner_verts_new[quad_ord[3]] = int(med_new_firstloop->v1); - -corner_edges_new[quad_ord_ofs[0]] = int((edge_offset + step + (i * (step_tot - 1))) - 1); -corner_edges_new[quad_ord_ofs[1]] = int(totedge + i2); -corner_edges_new[quad_ord_ofs[2]] = int(i); -corner_edges_new[quad_ord_ofs[3]] = int(totedge + i1); +corner_verts_new[new_loop_index + quad_ord[0]] = int(i1); +corner_verts_new[new_loop_index + quad_ord[1]] = int(i2); +corner_verts_new[new_loop_index + quad_ord[2]] = int(med_new_firstloop->v2); +corner_verts_new[new_loop_index + quad_ord[3]] = int(med_new_firstloop->v1); + +corner_edges_new[new_loop_index + quad_ord_ofs[0]] = int( +(edge_offset + step + (i * (step_tot - 1))) - 1); +corner_edges_new[new_loop_index + quad_ord_ofs[1]] = int(totedge + i2); +corner_edges_new[new_loop_index + quad_ord_ofs[2]] = int(i); +corner_edges_new[new_loop_index + quad_ord_ofs[3]] = int(totedge + i1); } mp_new++; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ddcaecd2b30] refactor-mesh-corners-generic: Fix mirror modifier
Commit: ddcaecd2b30fcd53891db0acfe68e10c64940cde Author: Hans Goudey Date: Tue Dec 20 13:54:45 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rBddcaecd2b30fcd53891db0acfe68e10c64940cde Fix mirror modifier === M source/blender/blenkernel/intern/mesh_mirror.cc === diff --git a/source/blender/blenkernel/intern/mesh_mirror.cc b/source/blender/blenkernel/intern/mesh_mirror.cc index 1dd3891a1f8..d3001440b64 100644 --- a/source/blender/blenkernel/intern/mesh_mirror.cc +++ b/source/blender/blenkernel/intern/mesh_mirror.cc @@ -345,10 +345,10 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, } /* adjust mirrored loop vertex and edge indices */ - int *corner_verts = BKE_mesh_corner_verts_for_write(result) + maxLoops; + int *corner_verts = BKE_mesh_corner_verts_for_write(result); for (i = 0; i < maxLoops; i++) { -corner_verts[i] += maxVerts; -corner_edges[i] += maxEdges; +corner_verts[maxLoops + i] += maxVerts; +corner_edges[maxLoops + i] += maxEdges; } /* handle uvs, @@ -490,6 +490,5 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, if (mesh_bisect != nullptr) { BKE_id_free(nullptr, mesh_bisect); } - return result; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [aa6b96cec6a] refactor-mesh-corners-generic: Merge branch 'master' into refactor-mesh-corners-generic
Commit: aa6b96cec6a2b4024eb84d6693102c444cd36fda Author: Hans Goudey Date: Tue Dec 20 11:29:49 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rBaa6b96cec6a2b4024eb84d6693102c444cd36fda Merge branch 'master' into refactor-mesh-corners-generic === === diff --cc source/blender/makesdna/DNA_customdata_types.h index c1164f5040b,3bff2f4316c..2d5a52b40f2 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@@ -88,11 -88,11 +88,11 @@@ typedef enum eCustomDataType */ CD_AUTO_FROM_NAME = -1, - CD_MVERT = 0, #ifdef DNA_DEPRECATED_ALLOW + CD_MVERT = 0, /* DEPRECATED */ CD_MSTICKY = 1, /* DEPRECATED */ #endif - CD_MDEFORMVERT = 2, + CD_MDEFORMVERT = 2, /* Array of `MDeformVert`. */ CD_MEDGE = 3, CD_MFACE = 4, CD_MTFACE = 5, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d5f063526b1] refactor-mesh-corners-generic: Merge branch 'master' into refactor-mesh-position-generic
Commit: d5f063526b17b9d69285ea0a01d783d762bf926a Author: Hans Goudey Date: Tue Dec 20 12:02:15 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rBd5f063526b17b9d69285ea0a01d783d762bf926a Merge branch 'master' into refactor-mesh-position-generic === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c1b29c0a36e] refactor-mesh-corners-generic: Fix mistake in mask modifier
Commit: c1b29c0a36e901aa4c309462ea7e50450297b1ad Author: Hans Goudey Date: Tue Dec 20 11:46:17 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rBc1b29c0a36e901aa4c309462ea7e50450297b1ad Fix mistake in mask modifier === M source/blender/modifiers/intern/MOD_mask.cc === diff --git a/source/blender/modifiers/intern/MOD_mask.cc b/source/blender/modifiers/intern/MOD_mask.cc index e2cb92b2a4b..88c3bd8a49a 100644 --- a/source/blender/modifiers/intern/MOD_mask.cc +++ b/source/blender/modifiers/intern/MOD_mask.cc @@ -299,10 +299,10 @@ static void compute_interpolated_polys(const Mesh *mesh, } if (0 < in_count && in_count < poly_src.totloop) { /* Ring search starting at a vertex which is not included in the mask. */ - const int *last_corner_vert = &corner_verts[start]; - bool v_loop_in_mask_last = vertex_mask[*last_corner_vert]; + int last_corner_vert = corner_verts[start]; + bool v_loop_in_mask_last = vertex_mask[last_corner_vert]; for (const int j : poly_verts_src.index_range()) { -const int &corner_vert = corner_verts[(start + 1 + j) % poly_src.totloop]; +const int corner_vert = corner_verts[(start + 1 + j) % poly_src.totloop]; const bool v_loop_in_mask = vertex_mask[corner_vert]; if (v_loop_in_mask && !v_loop_in_mask_last) { dst_totloop = 3; @@ -320,7 +320,7 @@ static void compute_interpolated_polys(const Mesh *mesh, BLI_assert(dst_totloop > 2); dst_totloop++; } -last_corner_vert = &corner_vert; +last_corner_vert = corner_vert; v_loop_in_mask_last = v_loop_in_mask; } } @@ -470,9 +470,9 @@ static void copy_masked_polys_to_new_mesh(const Mesh &src_mesh, mp_dst = mp_src; mp_dst.loopstart = i_ml_dst; -for (const int i : IndexRange(mp_dst.totloop)) { - dst_corner_verts[i_ml_dst + i] = src_corner_verts[vertex_map[i_ml_src + i]]; - dst_corner_edges[i_ml_dst + i] = src_corner_edges[edge_map[i_ml_src + i]]; +for (int i : IndexRange(mp_src.totloop)) { + dst_corner_verts[i_ml_dst + i] = vertex_map[src_corner_verts[i_ml_src + i]]; + dst_corner_edges[i_ml_dst + i] = edge_map[src_corner_edges[i_ml_src + i]]; } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [06d8865b0e3] refactor-mesh-corners-generic: Merge branch 'refactor-mesh-position-generic' into refactor-mesh-corners-generic
Commit: 06d8865b0e391379a6104d4d20397c27031fde67 Author: Hans Goudey Date: Tue Dec 20 12:02:50 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rB06d8865b0e391379a6104d4d20397c27031fde67 Merge branch 'refactor-mesh-position-generic' into refactor-mesh-corners-generic === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d5100cff529] refactor-mesh-corners-generic: Merge branch 'master' into refactor-mesh-position-generic
Commit: d5100cff529447887758d8e53f2a4a0d3109126d Author: Hans Goudey Date: Tue Dec 20 11:29:37 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rBd5100cff529447887758d8e53f2a4a0d3109126d Merge branch 'master' into refactor-mesh-position-generic === === diff --cc source/blender/makesdna/DNA_customdata_types.h index a9002fb2f11,3bff2f4316c..4984869f826 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@@ -88,11 -88,11 +88,11 @@@ typedef enum eCustomDataType */ CD_AUTO_FROM_NAME = -1, - CD_MVERT = 0, #ifdef DNA_DEPRECATED_ALLOW + CD_MVERT = 0, /* DEPRECATED */ CD_MSTICKY = 1, /* DEPRECATED */ #endif - CD_MDEFORMVERT = 2, + CD_MDEFORMVERT = 2, /* Array of `MDeformVert`. */ CD_MEDGE = 3, CD_MFACE = 4, CD_MTFACE = 5, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bf65f94f45b] blender-v2.93-release: Fix T89515: Clicking on Favorites in File Browser will rename them
Commit: bf65f94f45b720568cbb8a179493216cf0b4b192 Author: Julian Eisel Date: Mon Jun 28 19:41:28 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rBbf65f94f45b720568cbb8a179493216cf0b4b192 Fix T89515: Clicking on Favorites in File Browser will rename them Likely uncovered by 6c97c7f767c9, the actual mistake would be from 6942dd9f4900. The hacks to display text buttons for renaming in UI-Lists used the emboss of the text button for handling logic. It relied on the emboss `NONE` but we also introduced `NONE_OR_STATUS` with 6942dd9f4900. Both values need to be treated equally for the logic of this hack to work. The change in `interface_layout.c` is actually not needed for this exact issue, but it's the correct thing to do. There may actually be more cases where `NONE` and `NONE_OR_STATUS` need to be treated equally. Something to be checked still. === M source/blender/editors/interface/interface_handlers.c M source/blender/editors/interface/interface_layout.c M source/blender/editors/interface/interface_query.c === diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 3f0a7074dfc..7d85a570ca6 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4510,7 +4510,7 @@ static int ui_do_but_TEX( if (ELEM(event->type, EVT_PADENTER, EVT_RETKEY) && (!UI_but_is_utf8(but))) { /* pass - allow filesel, enter to execute */ } - else if (but->emboss == UI_EMBOSS_NONE && !event->ctrl) { + else if (ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS) && !event->ctrl) { /* pass */ } else { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 2c2ea70d0d2..a62c9b598e1 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2355,7 +2355,7 @@ void uiItemFullR(uiLayout *layout, /* Mark non-embossed textfields inside a listbox. */ if (but && (block->flag & UI_BLOCK_LIST_ITEM) && (but->type == UI_BTYPE_TEXT) && - (but->emboss & UI_EMBOSS_NONE)) { + ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS)) { UI_but_flag_enable(but, UI_BUT_LIST_ITEM); } diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c index aa10d092f5e..4c6efb0ded2 100644 --- a/source/blender/editors/interface/interface_query.c +++ b/source/blender/editors/interface/interface_query.c @@ -90,7 +90,8 @@ bool ui_but_is_interactive(const uiBut *but, const bool labeledit) if (but->flag & UI_SCROLLED) { return false; } - if ((but->type == UI_BTYPE_TEXT) && (but->emboss == UI_EMBOSS_NONE) && !labeledit) { + if ((but->type == UI_BTYPE_TEXT) && + (ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS)) && !labeledit) { return false; } if ((but->type == UI_BTYPE_LISTROW) && labeledit) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5bbee76cff0] blender-v2.93-release: Bump to 2.93.13 immediately due to a regression in 2.93.12.
Commit: 5bbee76cff0d5094303eb44304a49650f6c6ccd7 Author: Thomas Dinges Date: Tue Dec 20 20:35:23 2022 +0100 Branches: blender-v2.93-release https://developer.blender.org/rB5bbee76cff0d5094303eb44304a49650f6c6ccd7 Bump to 2.93.13 immediately due to a regression in 2.93.12. === M source/blender/blenkernel/BKE_blender_version.h === diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 5b38458c8ce..2c4e5bc12a3 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -33,7 +33,7 @@ extern "C" { /* Blender major and minor version. */ #define BLENDER_VERSION 293 /* Blender patch version for bugfix releases. */ -#define BLENDER_VERSION_PATCH 12 +#define BLENDER_VERSION_PATCH 13 /** Blender release cycle stage: alpha/beta/rc/release. */ #define BLENDER_VERSION_CYCLE release ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cc139344425] master: Cleanup: convert 'MOD_mirror.c' to C++
Commit: cc139344425e91bb4262698c0a94d4171db7ff1a Author: Germano Cavalcante Date: Tue Dec 20 15:08:18 2022 -0300 Branches: master https://developer.blender.org/rBcc139344425e91bb4262698c0a94d4171db7ff1a Cleanup: convert 'MOD_mirror.c' to C++ It will be useful to use the merge verts API in C++. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D16823 === M source/blender/modifiers/CMakeLists.txt R089source/blender/modifiers/intern/MOD_mirror.c source/blender/modifiers/intern/MOD_mirror.cc === diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index 63be9581175..910876fa361 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -62,7 +62,7 @@ set(SRC intern/MOD_meshcache_util.c intern/MOD_meshdeform.c intern/MOD_meshsequencecache.cc - intern/MOD_mirror.c + intern/MOD_mirror.cc intern/MOD_multires.cc intern/MOD_nodes.cc intern/MOD_none.c diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.cc similarity index 89% rename from source/blender/modifiers/intern/MOD_mirror.c rename to source/blender/modifiers/intern/MOD_mirror.cc index f1a36c04453..9e99a6b9a5e 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.cc @@ -60,7 +60,7 @@ static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *u static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) { MirrorModifierData *mmd = (MirrorModifierData *)md; - if (mmd->mirror_ob != NULL) { + if (mmd->mirror_ob != nullptr) { DEG_add_object_relation(ctx->node, mmd->mirror_ob, DEG_OB_COMP_TRANSFORM, "Mirror Modifier"); DEG_add_depends_on_transform_relation(ctx->node, "Mirror Modifier"); } @@ -82,7 +82,7 @@ static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd, Object *ob, Mesh mmd, ob, result, 1, use_correct_order_on_merge); if (tmp != mesh) { /* free intermediate results */ - BKE_id_free(NULL, tmp); + BKE_id_free(nullptr, tmp); } } if (mmd->flag & MOD_MIR_AXIS_Z) { @@ -91,7 +91,7 @@ static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd, Object *ob, Mesh mmd, ob, result, 2, use_correct_order_on_merge); if (tmp != mesh) { /* free intermediate results */ - BKE_id_free(NULL, tmp); + BKE_id_free(nullptr, tmp); } } @@ -108,7 +108,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return result; } -static void panel_draw(const bContext *UNUSED(C), Panel *panel) +static void panel_draw(const bContext * /*C*/, Panel *panel) { uiLayout *row, *col, *sub; uiLayout *layout = panel->layout; @@ -141,7 +141,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) uiItemS(col); - uiItemR(col, ptr, "mirror_object", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "mirror_object", 0, nullptr, ICON_NONE); uiItemR(col, ptr, "use_clip", 0, IFACE_("Clipping"), ICON_NONE); @@ -161,12 +161,12 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) modifier_panel_end(layout, ptr); } -static void data_panel_draw(const bContext *UNUSED(C), Panel *panel) +static void data_panel_draw(const bContext * /*C*/, Panel *panel) { uiLayout *col, *row, *sub; uiLayout *layout = panel->layout; - PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr); uiLayoutSetPropSep(layout, true); @@ -200,7 +200,7 @@ static void data_panel_draw(const bContext *UNUSED(C), Panel *panel) static void panelRegister(ARegionType *region_type) { PanelType *panel_type = modifier_panel_register(region_type, eModifierType_Mirror, panel_draw); - modifier_subpanel_register(region_type, "data", "Data", NULL, data_panel_draw, panel_type); + modifier_subpanel_register(region_type, "data", "Data", nullptr, data_panel_draw, panel_type); } ModifierTypeInfo modifierType_Mirror = { @@ -218,24 +218,24 @@ ModifierTypeInfo modifierType_Mirror = { /* copyData */ BKE_modifier_copydata_generic, -/* deformVerts */ NULL, -/* deformMatrices */ NULL, -/* deformVertsEM */ NULL, -/* deformMatricesEM */ NULL, +/* deformVerts */ nullptr, +/* deformMatrices */ nullptr, +/* deformVertsEM */ nullptr, +/* deformMatricesEM */ nullptr, /* modifyMesh */ modifyMesh, -/* modifyGeometrySet */ NULL, +/* modifyGeometrySet */ nullptr, /* initData */ initData, -/* requiredDataMask */ NULL, -/* freeData */ NULL, -/* isDisabled */ NULL, +/* requiredDataMask */ nullptr, +/* freeData */ nullptr, +/* isDisabled */ nullptr, /*
[Bf-blender-cvs] [99fcfdd9fb9] master: Tests: Print when mesh test starts, to help debugging crashes
Commit: 99fcfdd9fb913e03b2e6e4cd0764a88cbca88902 Author: Hans Goudey Date: Tue Dec 20 12:02:05 2022 -0600 Branches: master https://developer.blender.org/rB99fcfdd9fb913e03b2e6e4cd0764a88cbca88902 Tests: Print when mesh test starts, to help debugging crashes === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index b698540c367..1fc685023cb 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -238,6 +238,7 @@ class MeshTest(ABC): """ Runs a single test, runs it again if test file is updated. """ +print("\nSTART {} test.".format(self.test_name)) self.create_evaluated_object() self.apply_operations(self.evaluated_object.name) @@ -289,14 +290,14 @@ class MeshTest(ABC): """ Print results for failed test. """ -print("\nFAILED {} test with the following: ".format(self.test_name)) +print("FAILED {} test with the following: ".format(self.test_name)) self._print_result(result) def print_passed_test_result(self, result): """ Print results for passing test. """ -print("\nPASSED {} test successfully.".format(self.test_name)) +print("PASSED {} test successfully.".format(self.test_name)) self._print_result(result) def do_selection(self, mesh: bpy.types.Mesh, select_mode: str, selection, select_history: bool): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7907803694c] master: Tests: Remove random shuffling from modifiers test
Commit: 7907803694c50184539b7ed35a6337caa93d2af3 Author: Hans Goudey Date: Tue Dec 20 10:39:27 2022 -0600 Branches: master https://developer.blender.org/rB7907803694c50184539b7ed35a6337caa93d2af3 Tests: Remove random shuffling from modifiers test These are meant to be regression tests, not fuzz tests. The "random" shuffling made debugging quite annoying, even though the random order was the same every time. Instead, hard-code the two lists to make things more obvious. The resulting list doesn't make much sense (for example, the multires modifier has to be first in the stack), but for now avoid changing things further. Also remove some comments that weren't helpful. === M tests/python/modifiers.py === diff --git a/tests/python/modifiers.py b/tests/python/modifiers.py index 93448841dfd..f16d91d41f9 100644 --- a/tests/python/modifiers.py +++ b/tests/python/modifiers.py @@ -13,68 +13,48 @@ from modules.mesh_test import RunTest, ModifierSpec, SpecMeshTest seed(0) -def get_generate_modifiers_list(test_object_name, randomize=False): -""" -Construct a list of 'Generate' modifiers with default parameters. -:arg test_object_name: Name of test object. Some modifiers like boolean need an extra parameter beside - the default one. E.g. boolean needs object, mask needs vertex group etc... - The extra parameter name will be _ -:type test_object_name: str -:arg randomize: If True shuffle the list of modifiers. -:type randomize: bool -:return: list of 'Generate' modifiers with default parameters. -""" - -boolean_test_object = bpy.data.objects[test_object_name + "_boolean"] - +def cube_mask_first_modifier_list(): generate_modifiers = [ -ModifierSpec('array', 'ARRAY', {}), +ModifierSpec('mask', 'MASK', {'vertex_group': "testCubeMaskFirst_mask"}), +ModifierSpec('solidify', 'SOLIDIFY', {}), +ModifierSpec('triangulate', 'TRIANGULATE', {}), ModifierSpec('bevel', 'BEVEL', {'width': 0.1, 'limit_method': 'NONE'}), -ModifierSpec('boolean', 'BOOLEAN', {'object': boolean_test_object, 'solver': 'FAST'}), +ModifierSpec('boolean', 'BOOLEAN', {'object': bpy.data.objects["testCubeMaskFirst_boolean"], 'solver': 'FAST'}), +ModifierSpec('edge split', 'EDGE_SPLIT', {}), ModifierSpec('build', 'BUILD', {'frame_start': 1, 'frame_duration': 1}, 2), +ModifierSpec('multires', 'MULTIRES', {}), ModifierSpec('decimate', 'DECIMATE', {}), -ModifierSpec('edge split', 'EDGE_SPLIT', {}), - -# mask can effectively delete the mesh since the vertex group need to be updated after each -# applied modifier. Needs to be tested separately. -# ModifierSpec('mask', 'MASK', {'vertex_group': mask_vertex_group}, False), +ModifierSpec('array', 'ARRAY', {}), +ModifierSpec('wireframe', 'WIREFRAME', {}), +ModifierSpec('mirror', 'MIRROR', {}), +] +return generate_modifiers +def cube_random_modifier_list(): +generate_modifiers = [ +ModifierSpec('edge split', 'EDGE_SPLIT', {}), +ModifierSpec('decimate', 'DECIMATE', {}), +ModifierSpec('wireframe', 'WIREFRAME', {}), ModifierSpec('mirror', 'MIRROR', {}), +ModifierSpec('array', 'ARRAY', {}), +ModifierSpec('bevel', 'BEVEL', {'width': 0.1, 'limit_method': 'NONE'}), ModifierSpec('multires', 'MULTIRES', {}), - -# remesh can also generate an empty mesh. Skip. -# ModifierSpec('remesh', 'REMESH', {}), - -# ModifierSpec('screw', 'SCREW', {}), # screw can make the test very slow. Skipping for now. - +ModifierSpec('boolean', 'BOOLEAN', {'object': bpy.data.objects["testCubeRandom_boolean"], 'solver': 'FAST'}), ModifierSpec('solidify', 'SOLIDIFY', {}), -# Opensubdiv results might differ slightly when compiled with different optimization flags. -#ModifierSpec('subsurf', 'SUBSURF', {}), +ModifierSpec('build', 'BUILD', {'frame_start': 1, 'frame_duration': 1}, 2), ModifierSpec('triangulate', 'TRIANGULATE', {}), -ModifierSpec('wireframe', 'WIREFRAME', {}) - ] - -if randomize: -shuffle(generate_modifiers) - return generate_modifiers - def main(): -mask_first_list = get_generate_modifiers_list("testCubeMaskFirst", randomize=True) -mask_vertex_group = "testCubeMaskFirst" + "_mask" -mask_first_list.insert(0, ModifierSpec('mask', 'MASK', {'vertex_group': mask_vertex_group})) tests = [ ### # List of 'Generate' modifiers on a cube ### # 0 -# SpecMeshTest("testCube", "expectedCube", get_generate_modifiers_list("testCube")), -SpecMeshTest("CubeRandom", "testCubeRandom", "expectedCubeRandom", -
[Bf-blender-cvs] [45103e3a88c] tmp-workbench-rewrite2: Merge branch 'master' into tmp-workbench-rewrite2
Commit: 45103e3a88cac0c50784dbc11da31b5e06211f43 Author: Miguel Pozo Date: Tue Dec 20 17:12:43 2022 +0100 Branches: tmp-workbench-rewrite2 https://developer.blender.org/rB45103e3a88cac0c50784dbc11da31b5e06211f43 Merge branch 'master' into tmp-workbench-rewrite2 === === diff --cc source/blender/gpu/intern/gpu_texture_private.hh index aad56639859,fc5e39a3534..20543391691 --- a/source/blender/gpu/intern/gpu_texture_private.hh +++ b/source/blender/gpu/intern/gpu_texture_private.hh @@@ -41,8 -41,21 +41,21 @@@ typedef enum eGPUTextureType GPU_TEXTURE_CUBE_ARRAY = (GPU_TEXTURE_CUBE | GPU_TEXTURE_ARRAY), } eGPUTextureType; -ENUM_OPERATORS(eGPUTextureType, GPU_TEXTURE_CUBE_ARRAY) +ENUM_OPERATORS(eGPUTextureType, GPU_TEXTURE_BUFFER) + /* Format types for samplers within the shader. + * This covers the sampler format type permutations within GLSL/MSL.*/ + typedef enum eGPUSamplerFormat { + GPU_SAMPLER_TYPE_FLOAT = 0, + GPU_SAMPLER_TYPE_INT = 1, + GPU_SAMPLER_TYPE_UINT = 2, + /* Special case for depth, as these require differing dummy formats. */ + GPU_SAMPLER_TYPE_DEPTH = 3, + GPU_SAMPLER_TYPE_MAX = 4 + } eGPUSamplerFormat; + + ENUM_OPERATORS(eGPUSamplerFormat, GPU_SAMPLER_TYPE_UINT) + #ifdef DEBUG # define DEBUG_NAME_LEN 64 #else ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6799dd1e88d] refactor-mesh-corners-generic: Three fixes to corner indexing
Commit: 6799dd1e88de9a00115c91ea637ebf4d47f0285b Author: Hans Goudey Date: Tue Dec 20 09:50:06 2022 -0600 Branches: refactor-mesh-corners-generic https://developer.blender.org/rB6799dd1e88de9a00115c91ea637ebf4d47f0285b Three fixes to corner indexing === M source/blender/blenkernel/intern/DerivedMesh.cc M source/blender/blenkernel/intern/mesh_remap.cc M source/blender/modifiers/intern/MOD_surfacedeform.c === diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc b/source/blender/blenkernel/intern/DerivedMesh.cc index 8a089c708e5..dcac7571284 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.cc +++ b/source/blender/blenkernel/intern/DerivedMesh.cc @@ -1991,7 +1991,7 @@ static void mesh_init_origspace(Mesh *mesh) vcos_2d.resize(mp->totloop); for (j = 0; j < mp->totloop; j++) { -mul_v3_m3v3(co, mat, positions[corner_verts[mp->totloop + j]]); +mul_v3_m3v3(co, mat, positions[corner_verts[mp->loopstart + j]]); copy_v2_v2(vcos_2d[j], co); for (k = 0; k < 2; k++) { diff --git a/source/blender/blenkernel/intern/mesh_remap.cc b/source/blender/blenkernel/intern/mesh_remap.cc index f88173292df..45b68dc0e8b 100644 --- a/source/blender/blenkernel/intern/mesh_remap.cc +++ b/source/blender/blenkernel/intern/mesh_remap.cc @@ -1605,7 +1605,7 @@ void BKE_mesh_remap_calc_loops_from_mesh(const int mode, BVHTreeFromMesh *tdata = &treedata[tindex]; for (plidx_dst = 0; plidx_dst < mp_dst->totloop; plidx_dst++) { - const int vert_dst_i = corner_verts_dst[mp_dst->totloop + plidx_dst]; + const int vert_dst_i = corner_verts_dst[mp_dst->loopstart + plidx_dst]; if (use_from_vert) { MeshElemMap *vert_to_refelem_map_src = nullptr; diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c index 013dfae5a0c..44cea45ce4c 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.c +++ b/source/blender/modifiers/intern/MOD_surfacedeform.c @@ -554,8 +554,8 @@ BLI_INLINE SDefBindWeightData *computeBindWeights(SDefBindCalcData *const data, } for (int j = 0; j < poly->totloop; j++) { - const int vert_i = data->corner_verts[poly->totloop + j]; - const int edge_i = data->corner_edges[poly->totloop + j]; + const int vert_i = data->corner_verts[poly->loopstart + j]; + const int edge_i = data->corner_edges[poly->loopstart + j]; copy_v3_v3(bpoly->coords[j], data->targetCos[vert_i]); /* Find corner and edge indices within poly loop array */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [87482b8a9e0] tmp-workbench-rewrite2: Fix GPU debug names
Commit: 87482b8a9e0adce66bbeb44269759f4018c36934 Author: Miguel Pozo Date: Tue Dec 20 16:38:07 2022 +0100 Branches: tmp-workbench-rewrite2 https://developer.blender.org/rB87482b8a9e0adce66bbeb44269759f4018c36934 Fix GPU debug names === M source/blender/draw/engines/workbench/workbench_mesh_passes.cc === diff --git a/source/blender/draw/engines/workbench/workbench_mesh_passes.cc b/source/blender/draw/engines/workbench/workbench_mesh_passes.cc index 1a00ef83395..cd71bb7c6a3 100644 --- a/source/blender/draw/engines/workbench/workbench_mesh_passes.cc +++ b/source/blender/draw/engines/workbench/workbench_mesh_passes.cc @@ -32,13 +32,18 @@ void MeshPass::init_subpasses(ePipelineType pipeline, { texture_subpass_map_.clear(); + static std::string pass_names[geometry_type_len][shader_type_len] = {}; + for (auto geom : IndexRange(geometry_type_len)) { for (auto shader : IndexRange(shader_type_len)) { eGeometryType geom_type = static_cast(geom); eShaderType shader_type = static_cast(shader); - std::string name = std::string(get_name(geom_type)) + std::string(get_name(shader_type)); + if (pass_names[geom][shader].empty()) { +pass_names[geom][shader] = std::string(get_name(geom_type)) + + std::string(get_name(shader_type)); + } GPUShader *sh = shaders.prepass_shader_get(pipeline, geom_type, shader_type, lighting, clip); - PassMain::Sub *pass = &sub(name.c_str()); + PassMain::Sub *pass = &sub(pass_names[geom][shader].c_str()); pass->shader_set(sh); passes_[geom][shader] = pass; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6b7160ed3bd] tmp-workbench-rewrite2: Fix GPU debug groups
Commit: 6b7160ed3bdd4abdad00cf443eb13c93cad5d01f Author: Miguel Pozo Date: Tue Dec 20 16:30:05 2022 +0100 Branches: tmp-workbench-rewrite2 https://developer.blender.org/rB6b7160ed3bdd4abdad00cf443eb13c93cad5d01f Fix GPU debug groups === M source/blender/draw/engines/workbench/workbench_shadow.cc === diff --git a/source/blender/draw/engines/workbench/workbench_shadow.cc b/source/blender/draw/engines/workbench/workbench_shadow.cc index e82f032db8e..0259233cb9f 100644 --- a/source/blender/draw/engines/workbench/workbench_shadow.cc +++ b/source/blender/draw/engines/workbench/workbench_shadow.cc @@ -223,6 +223,7 @@ void ShadowPass::ShadowView::compute_visibility(ObjectBoundsBuf &bounds, } else if (current_pass_type_ == ShadowPass::Fail) { /* Already computed in the ShadowPass::Pass */ +GPU_debug_group_end(); return; } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7c77bc9a54c] gpencil-new-data-proposal: Rename CurveGeometry getter in new gpencil structure
Commit: 7c77bc9a54c1eeb27646adffb6847497f37ef396 Author: Amelie Fondevilla Date: Tue Dec 20 15:53:05 2022 +0100 Branches: gpencil-new-data-proposal https://developer.blender.org/rB7c77bc9a54c1eeb27646adffb6847497f37ef396 Rename CurveGeometry getter in new gpencil structure === M release/datafiles/locale M release/scripts/addons M release/scripts/addons_contrib M source/blender/blenkernel/intern/gpencil_new_proposal.cc M source/blender/blenkernel/intern/gpencil_new_proposal.hh M source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc M source/blender/blenkernel/intern/gpencil_new_proposal_test.cc M source/tools === diff --git a/release/datafiles/locale b/release/datafiles/locale index 4a581c54af9..6514c6647d4 16 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 4a581c54af9b92cb670d750951b9382160f10f3e +Subproject commit 6514c6647d4019971c54c436cd2288a9f84c7b28 diff --git a/release/scripts/addons b/release/scripts/addons index 0b0052bd53a..5ba2c7517e8 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 0b0052bd53ad8249ed07dfb87705c338af698bde +Subproject commit 5ba2c7517e8577e3cfe1dcb2e29a4627842e2aea diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 96143b1a8b0..bdcfdd47ec3 16 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 96143b1a8b037ea3c81f065f557025db9fe1ace3 +Subproject commit bdcfdd47ec3451822b21d1cff2ea2db751093c9a diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal.cc b/source/blender/blenkernel/intern/gpencil_new_proposal.cc index c3d6ada6071..3a9767f253d 100644 --- a/source/blender/blenkernel/intern/gpencil_new_proposal.cc +++ b/source/blender/blenkernel/intern/gpencil_new_proposal.cc @@ -164,7 +164,7 @@ bool GPFrame::operator==(const GPFrame &other) const return this->layer_index == other.layer_index && this->start_time == other.start_time; } -CurvesGeometry &GPFrame::strokes_as_curves() +CurvesGeometry &GPFrame::curves() { if (!this->strokes) { this->strokes = MEM_new(__func__); @@ -172,7 +172,7 @@ CurvesGeometry &GPFrame::strokes_as_curves() return CurvesGeometry::wrap(*this->strokes); } -const CurvesGeometry &GPFrame::strokes_as_curves() const +const CurvesGeometry &GPFrame::curves() const { BLI_assert(this->strokes != nullptr); return CurvesGeometry::wrap(*this->strokes); @@ -201,7 +201,7 @@ int GPFrame::points_num() const IndexRange GPFrame::add_new_stroke(int new_points_num) { - CurvesGeometry &strokes = this->strokes_as_curves(); + CurvesGeometry &strokes = this->curves(); int orig_last_offset = strokes.offsets().last(); strokes.resize(strokes.points_num() + new_points_num, strokes.curves_num() + 1); diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal.hh b/source/blender/blenkernel/intern/gpencil_new_proposal.hh index 461de5c8041..c61948c5175 100644 --- a/source/blender/blenkernel/intern/gpencil_new_proposal.hh +++ b/source/blender/blenkernel/intern/gpencil_new_proposal.hh @@ -258,8 +258,8 @@ class GPFrame : public ::GPFrame { bool operator==(const GPFrame &other) const; - CurvesGeometry &strokes_as_curves(); - const CurvesGeometry &strokes_as_curves() const; + CurvesGeometry &curves(); + const CurvesGeometry &curves() const; bool is_empty() const; int strokes_num() const; diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc b/source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc index 7e155b57f72..a076c49b1ce 100644 --- a/source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc +++ b/source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc @@ -27,7 +27,7 @@ GPData convert_old_to_new_gpencil_data(bGPdata *old_gpd) offsets.append(old_gps->totpoints + offsets.last()); } - CurvesGeometry &new_gps{new_gpf.strokes_as_curves()}; + CurvesGeometry &new_gps{new_gpf.curves()}; MutableAttributeAccessor attributes = new_gps.attributes_for_write(); new_gps.resize(offsets.last(), offsets.size() - 1); new_gps.offsets_for_write().copy_from(offsets); @@ -81,11 +81,12 @@ bGPdata *convert_new_to_old_gpencil_data(const GPData &new_gpd) old_gpf->framenum = new_gpf.start_time; BLI_listbase_clear(&old_gpf->strokes); - const CurvesGeometry &new_gps{new_gpf.strokes_as_curves()}; + const CurvesGeometry &new_gps{new_gpf.curves()}; AttributeAccessor attributes = new_gps.attributes(); Span new_gps_positions = new_gps.positions(); - VArray new_gps_radii = attributes.lookup_or_default(ATTR_RADIUS, ATTR_DOMAIN_POINT, 0); + VArray new_gps_radii = attributes.lookup_or_default( + AT
[Bf-blender-cvs] [f8bc7be60fb] temp-T101739-fix-seam-bleeding-non-manifold: Copy pixels classes.
Commit: f8bc7be60fbad611b0d3536f107056f4c382547b Author: Jeroen Bakker Date: Tue Dec 20 15:23:27 2022 +0100 Branches: temp-T101739-fix-seam-bleeding-non-manifold https://developer.blender.org/rBf8bc7be60fbad611b0d3536f107056f4c382547b Copy pixels classes. === M source/blender/blenkernel/CMakeLists.txt A source/blender/blenkernel/intern/pbvh_pixels_copy.cc M source/blender/blenlib/BLI_math_vec_types.hh === diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index c12c0c06ed8..c26c5d1bc4d 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -251,6 +251,7 @@ set(SRC intern/pbvh.cc intern/pbvh_bmesh.c intern/pbvh_pixels.cc + intern/pbvh_pixels_copy.cc intern/pbvh_uv_islands.cc intern/pointcache.c intern/pointcloud.cc diff --git a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc new file mode 100644 index 000..a80e6606037 --- /dev/null +++ b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc @@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright 2022 Blender Foundation. All rights reserved. */ + +#include "BLI_math_vec_types.hh" +#include "BLI_vector.hh" +#include "BLI_math.h" + +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" + +namespace blender::kernel::pbvh::pixels { +template struct ImageBufferAccessor { + ImBuf &image_buffer; + + ImageBufferAccessor(ImBuf &image_buffer) : image_buffer(image_buffer) + { + } + + float4 read_pixel(const int2 coordinate) + { +int offset = (coordinate.y * image_buffer.x + coordinate.x) * Channels; +return float4(&image_buffer.rect_float[offset]); + } + + void write_pixel(const int2 coordinate, float4 new_value) + { +int offset = (coordinate.y * image_buffer.x + coordinate.x) * Channels; +copy_v4_v4(&image_buffer.rect_float[offset], new_value); + } +}; + +struct PixelCopyItem { + uint8_t delta_destination_x; + char2 delta_source_1; + char2 delta_source_2; + uint8_t mix_factor; +}; + +struct PixelCopyGroup { + int2 destination; + Vector items; +}; + +/** Pixel copy command to mix 2 source pixels and write to a destination pixel. */ +struct PixelCopyCommand { + /** Pixel coordinate to write to. */ + int2 destination; + /** Pixel coordinate to read first source from. */ + int2 source_1; + /** Pixel coordinate to read second source from. */ + int2 source_2; + /** Factor to mix between first and second source. */ + float mix_factor; + + PixelCopyCommand(const PixelCopyGroup &group) + : destination(group.destination), +source_1(group.destination), +source_2(group.destination), +mix_factor(0.0f) + { + } + + template void mix_source_and_write_destination(ImageBufferAccessor &tile_buffer) const + { +float4 source_color_1 = tile_buffer.read_pixel(source_1); +float4 source_color_2 = tile_buffer.read_pixel(source_2); +float4 destination_color = source_color_1 * (1.0f - mix_factor) + source_color_2 * mix_factor; +tile_buffer.write_pixel(destination, destination_color); + } +}; + +PixelCopyCommand &operator+=(PixelCopyCommand &command, const PixelCopyItem &item) +{ + command.destination.x += int(item.delta_destination_x); + command.source_1 += int2(item.delta_source_1); + command.source_2 += int2(item.delta_source_2); + command.mix_factor = float(item.mix_factor) / 255.0f; + return command; +} + +struct PixelCopyGroups { + Vector groups; + + void copy_pixels(ImBuf &tile_buffer) const + { +if (tile_buffer.rect_float) { + ImageBufferAccessor accessor(tile_buffer); + copy_pixels(accessor); +} +else { + ImageBufferAccessor accessor(tile_buffer); + copy_pixels(accessor); +} + } + + private: + template void copy_pixels(ImageBufferAccessor &image_buffer) const + { +for (const PixelCopyGroup &group : groups) { + PixelCopyCommand copy_command(group); + for (const PixelCopyItem &item : group.items) { +copy_command += item; +copy_command.mix_source_and_write_destination(image_buffer); + } +} + } +}; + +} // namespace blender::kernel::pbvh::pixels diff --git a/source/blender/blenlib/BLI_math_vec_types.hh b/source/blender/blenlib/BLI_math_vec_types.hh index f57b4b44e61..20a8539c67c 100644 --- a/source/blender/blenlib/BLI_math_vec_types.hh +++ b/source/blender/blenlib/BLI_math_vec_types.hh @@ -602,6 +602,7 @@ template struct vec_base : public vec_struct_base } }; +using char2 = blender::vec_base; using char3 = blender::vec_base; using uchar3 = blender::vec_base; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listi
[Bf-blender-cvs] [adc92cc23e7] master: Fix T103357: Grease pencil layer color not displayed in main dopesheet backdrop
Commit: adc92cc23e74ce10cff95f58fd517ed7c23d3779 Author: Amelie Fondevilla Date: Tue Dec 20 13:14:21 2022 +0100 Branches: master https://developer.blender.org/rBadc92cc23e74ce10cff95f58fd517ed7c23d3779 Fix T103357: Grease pencil layer color not displayed in main dopesheet backdrop Reviewed By: Sybren A. Stüvel Differential Revision: https://developer.blender.org/D16822 === M source/blender/editors/space_action/action_draw.c === diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 343975919e2..de3d306a0be 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -272,6 +272,20 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region } break; } +case ANIMTYPE_GPLAYER: { + if (show_group_colors) { +uchar gpl_col[4]; +bGPDlayer *gpl = (bGPDlayer *)ale->data; +rgb_float_to_uchar(gpl_col, gpl->color); +gpl_col[3] = col1[3]; + +immUniformColor4ubv(sel ? col1 : gpl_col); + } + else { +immUniformColor4ubv(sel ? col1 : col2); + } + break; +} default: { immUniformColor4ubv(sel ? col1 : col2); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ddd24186d9e] master: Geometry Nodes: avoid some overhead during field inferencing
Commit: ddd24186d9e994e445e2bc6c872fcd340db89f10 Author: Jacques Lucke Date: Tue Dec 20 14:36:00 2022 +0100 Branches: master https://developer.blender.org/rBddd24186d9e994e445e2bc6c872fcd340db89f10 Geometry Nodes: avoid some overhead during field inferencing Previously, the same `FieldInferencingInterface` was build for every node multiple times. Now only once during the inferencing. Going forward, it would be even better to store the inferencing interface as part of the node declaration to avoid building it during inferencing at all. === M source/blender/blenkernel/intern/node_tree_field_inferencing.cc === diff --git a/source/blender/blenkernel/intern/node_tree_field_inferencing.cc b/source/blender/blenkernel/intern/node_tree_field_inferencing.cc index 88fd3636633..5c527e29131 100644 --- a/source/blender/blenkernel/intern/node_tree_field_inferencing.cc +++ b/source/blender/blenkernel/intern/node_tree_field_inferencing.cc @@ -5,6 +5,7 @@ #include "NOD_node_declaration.hh" +#include "BLI_resource_scope.hh" #include "BLI_set.hh" #include "BLI_stack.hh" @@ -91,9 +92,10 @@ static OutputFieldDependency get_interface_output_field_dependency(const bNode & return socket_decl.output_field_dependency(); } -static FieldInferencingInterface get_dummy_field_inferencing_interface(const bNode &node) +static const FieldInferencingInterface &get_dummy_field_inferencing_interface(const bNode &node, + ResourceScope &scope) { - FieldInferencingInterface inferencing_interface; + auto &inferencing_interface = scope.construct(); inferencing_interface.inputs.append_n_times(InputSocketFieldType::None, node.input_sockets().size()); inferencing_interface.outputs.append_n_times(OutputFieldDependency::ForDataSource(), @@ -106,17 +108,19 @@ static FieldInferencingInterface get_dummy_field_inferencing_interface(const bNo * In the future, this information can be stored in the node declaration. This would allow this * function to return a reference, making it more efficient. */ -static FieldInferencingInterface get_node_field_inferencing_interface(const bNode &node) +static const FieldInferencingInterface &get_node_field_inferencing_interface(const bNode &node, + ResourceScope &scope) { /* Node groups already reference all required information, so just return that. */ if (node.is_group()) { bNodeTree *group = (bNodeTree *)node.id; if (group == nullptr) { - return FieldInferencingInterface(); + static const FieldInferencingInterface empty_interface; + return empty_interface; } if (!ntreeIsRegistered(group)) { /* This can happen when there is a linked node group that was not found (see T92799). */ - return get_dummy_field_inferencing_interface(node); + return get_dummy_field_inferencing_interface(node, scope); } if (!group->runtime->field_inferencing_interface) { /* This shouldn't happen because referenced node groups should always be updated first. */ @@ -125,7 +129,7 @@ static FieldInferencingInterface get_node_field_inferencing_interface(const bNod return *group->runtime->field_inferencing_interface; } - FieldInferencingInterface inferencing_interface; + auto &inferencing_interface = scope.construct(); for (const bNodeSocket *input_socket : node.input_sockets()) { inferencing_interface.inputs.append(get_interface_input_field_type(node, *input_socket)); } @@ -185,7 +189,9 @@ static Vector gather_input_socket_dependencies( * to figure out if it is always a field or if it depends on any group inputs. */ static OutputFieldDependency find_group_output_dependencies( -const bNodeSocket &group_output_socket, const Span field_state_by_socket_id) +const bNodeSocket &group_output_socket, +const Span interface_by_node, +const Span field_state_by_socket_id) { if (!is_field_socket_type(group_output_socket)) { return OutputFieldDependency::ForDataSource(); @@ -227,8 +233,8 @@ static OutputFieldDependency find_group_output_dependencies( } } else if (!origin_state.is_single) { -const FieldInferencingInterface inferencing_interface = -get_node_field_inferencing_interface(origin_node); +const FieldInferencingInterface &inferencing_interface = +*interface_by_node[origin_node.index()]; const OutputFieldDependency &field_dependency = inferencing_interface.outputs[origin_socket->index()]; @@ -251,13 +257,14 @@ static OutputFieldDependency find_group_output_dependencies( } static void propagate_data_requirements_from_right_to_left( -const bNodeTree &tree, co
[Bf-blender-cvs] [dedca2c9948] master: Fix T103313: Resolve shader compilation failures when enabling GPU workarounds.
Commit: dedca2c9948af7a65dd78263e37f77052fc03de7 Author: Jason Fielder Date: Tue Dec 20 14:18:13 2022 +0100 Branches: master https://developer.blender.org/rBdedca2c9948af7a65dd78263e37f77052fc03de7 Fix T103313: Resolve shader compilation failures when enabling GPU workarounds. A number of paths resulted in compilation errors after porting EEVEE to use Create-Info. Namely the fallback path for cubemap support. A number of other strict compilation failures regarding format comparison also required fixing when this mode is enabled. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261, T103313 Differential Revision: https://developer.blender.org/D16819 === M source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl M source/blender/draw/engines/eevee/shaders/shadow_vert.glsl M source/blender/draw/engines/eevee/shaders/surface_vert.glsl M source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl M source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_common_lib.glsl M source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert.glsl M source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_vert.glsl M source/blender/draw/engines/overlay/shaders/overlay_edit_uv_faces_vert.glsl M source/blender/draw/engines/overlay/shaders/overlay_edit_uv_verts_vert.glsl M source/blender/draw/engines/overlay/shaders/overlay_motion_path_point_vert.glsl M source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl M source/blender/gpu/shaders/gpu_shader_keyframe_shape_frag.glsl M source/blender/gpu/shaders/metal/mtl_shader_defines.msl M source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl === diff --git a/source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl b/source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl index cde52af39e0..30e11d57c9b 100644 --- a/source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl @@ -1,12 +1,7 @@ -#ifdef GPU_ARB_texture_cube_map_array - -# define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod) - -#else - -/* Fallback implementation for hardware not supporting cubemap arrays. */ -# define samplerCubeArray sampler2DArray +/* Fallback implementation for hardware not supporting cubemap arrays. + * `samplerCubeArray` fallback declaration as sampler2DArray in `glsl_shader_defines.glsl`*/ +#ifndef GPU_ARB_texture_cube_map_array float cubemap_face_index(vec3 P) { diff --git a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl index 92be7294a11..8a99f2cc5e2 100644 --- a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl @@ -70,7 +70,7 @@ int g_curves_attr_id = 0; int curves_attribute_element_id() { int id = hairStrandID; - if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0) { + if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0u) { id = hair_get_base_id(); } diff --git a/source/blender/draw/engines/eevee/shaders/surface_vert.glsl b/source/blender/draw/engines/eevee/shaders/surface_vert.glsl index 212208728a0..a0eddc583b7 100644 --- a/source/blender/draw/engines/eevee/shaders/surface_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/surface_vert.glsl @@ -77,7 +77,7 @@ int g_curves_attr_id = 0; int curves_attribute_element_id() { int id = hairStrandID; - if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0) { + if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0u) { id = hair_get_base_id(); } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl index ea1b02e56b3..f3bb1e2f490 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl @@ -133,7 +133,7 @@ int g_curves_attr_id = 0; int curves_attribute_element_id() { int id = interp.curves_strand_id; - if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0) { + if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0u) { # ifdef COMMON_HAIR_LIB id = hair_get_base_id(); # endif diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_common_lib.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_common_lib.glsl index 88a976931cc..358a18c88d0 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_common_lib.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_common_lib.glsl @@ -17,7 +17,7 @@ vec4 EDIT_MESH_edge_color_inner(
[Bf-blender-cvs] [b3464fe152c] master: Metal: Implement suppot for clip plane toggling via GPU_clip_distances.
Commit: b3464fe152ca8a7b50dddf0774e33d24e38fd6b5 Author: Jason Fielder Date: Tue Dec 20 14:15:52 2022 +0100 Branches: master https://developer.blender.org/rBb3464fe152ca8a7b50dddf0774e33d24e38fd6b5 Metal: Implement suppot for clip plane toggling via GPU_clip_distances. The Metal backend already supports output for the 6 clipping planes via gl_ClipDistances equivalent, however, functionality to toggle clipping plane enablement was missing. Authored by Apple: Michael Parkin-White Ref T96261 Depends on D16777 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D16813 === M source/blender/draw/engines/eevee/shaders/infos/eevee_legacy_material_info.hh M source/blender/gpu/metal/mtl_context.hh M source/blender/gpu/metal/mtl_pso_descriptor_state.hh M source/blender/gpu/metal/mtl_shader.mm M source/blender/gpu/metal/mtl_shader_generator.mm M source/blender/gpu/metal/mtl_state.hh M source/blender/gpu/metal/mtl_state.mm M source/blender/gpu/shaders/metal/mtl_shader_common.msl === diff --git a/source/blender/draw/engines/eevee/shaders/infos/eevee_legacy_material_info.hh b/source/blender/draw/engines/eevee/shaders/infos/eevee_legacy_material_info.hh index 2d1671ac98d..dd848d6fef9 100644 --- a/source/blender/draw/engines/eevee/shaders/infos/eevee_legacy_material_info.hh +++ b/source/blender/draw/engines/eevee/shaders/infos/eevee_legacy_material_info.hh @@ -59,7 +59,9 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_material_surface_vert_common) .additional_info("eevee_legacy_material_empty_base") .additional_info("draw_resource_id_varying") .additional_info("eevee_legacy_common_utiltex_lib") -.additional_info("eevee_legacy_closure_eval_surface_lib"); +.additional_info("eevee_legacy_closure_eval_surface_lib") +/* Planar reflections assigns to gl_ClipDistance via surface_vert.glsl. */ +.define("USE_CLIP_PLANES"); GPU_SHADER_CREATE_INFO(eevee_legacy_material_surface_vert) .additional_info("eevee_legacy_material_surface_vert_common") diff --git a/source/blender/gpu/metal/mtl_context.hh b/source/blender/gpu/metal/mtl_context.hh index 3656fbdcd19..a26e31aadde 100644 --- a/source/blender/gpu/metal/mtl_context.hh +++ b/source/blender/gpu/metal/mtl_context.hh @@ -460,6 +460,9 @@ struct MTLContextGlobalShaderPipelineState { /* Render parameters. */ float point_size = 1.0f; float line_width = 1.0f; + + /* Clipping plane enablement. */ + bool clip_distance_enabled[6] = {false}; }; /* Command Buffer Manager - Owned by MTLContext. diff --git a/source/blender/gpu/metal/mtl_pso_descriptor_state.hh b/source/blender/gpu/metal/mtl_pso_descriptor_state.hh index 8b0d69c6251..1890f6e8ccd 100644 --- a/source/blender/gpu/metal/mtl_pso_descriptor_state.hh +++ b/source/blender/gpu/metal/mtl_pso_descriptor_state.hh @@ -174,6 +174,9 @@ struct MTLRenderPipelineStateDescriptor { /* Global color write mask as this cannot be specified per attachment. */ MTLColorWriteMask color_write_mask; + /* Clip distance enablement. */ + uchar clipping_plane_enable_mask = 0; + /* Point size required by point primitives. */ float point_size = 0.0f; @@ -184,6 +187,10 @@ struct MTLRenderPipelineStateDescriptor { return false; } +if (clipping_plane_enable_mask != other.clipping_plane_enable_mask) { + return false; +} + if ((num_color_attachments != other.num_color_attachments) || (depth_attachment_format != other.depth_attachment_format) || (stencil_attachment_format != other.stencil_attachment_format) || @@ -243,6 +250,9 @@ struct MTLRenderPipelineStateDescriptor { hash |= uint64_t((this->blending_enabled && (this->num_color_attachments > 0)) ? 1 : 0) << 62; hash ^= uint64_t(this->point_size); +/* Clipping plane enablement. */ +hash ^= uint64_t(clipping_plane_enable_mask) << 20; + return hash; } diff --git a/source/blender/gpu/metal/mtl_shader.mm b/source/blender/gpu/metal/mtl_shader.mm index 747746ea424..496f919d189 100644 --- a/source/blender/gpu/metal/mtl_shader.mm +++ b/source/blender/gpu/metal/mtl_shader.mm @@ -654,6 +654,14 @@ MTLRenderPipelineStateInstance *MTLShader::bake_current_pipeline_state( pipeline_descriptor.src_rgb_blend_factor = ctx->pipeline_state.src_rgb_blend_factor; pipeline_descriptor.point_size = ctx->pipeline_state.point_size; + /* Resolve clipping plane enablement. */ + pipeline_descriptor.clipping_plane_enable_mask = 0; + for (const int plane : IndexRange(6)) { +pipeline_descriptor.clipping_plane_enable_mask = +pipeline_descriptor.clipping_plane_enable_mask | +((ctx->pipeline_state.clip_distance_enabled[plane]) ? (1 << plane) : 0); + } + /* Primitive Type -- Primitive topology class needs to be specified for layered renderi
[Bf-blender-cvs] [df1fe18ed75] master: Metal: Fix GPencil texture buffer attribute packing issue and cutting tool rendering.
Commit: df1fe18ed75812265cf2af186f6b082d8d27d9fe Author: Jason Fielder Date: Tue Dec 20 14:08:37 2022 +0100 Branches: master https://developer.blender.org/rBdf1fe18ed75812265cf2af186f6b082d8d27d9fe Metal: Fix GPencil texture buffer attribute packing issue and cutting tool rendering. Line Loop topology support for cutting tool and add support for packing several vertex attributes across individual pixels within a texture buffer. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D16783 === M source/blender/gpu/metal/mtl_immediate.mm M source/blender/gpu/metal/mtl_primitive.hh M source/blender/gpu/metal/mtl_texture.mm === diff --git a/source/blender/gpu/metal/mtl_immediate.mm b/source/blender/gpu/metal/mtl_immediate.mm index 7af5ca30578..f0809e6e9d3 100644 --- a/source/blender/gpu/metal/mtl_immediate.mm +++ b/source/blender/gpu/metal/mtl_immediate.mm @@ -39,8 +39,16 @@ uchar *MTLImmediate::begin() metal_primitive_mode_ = mtl_prim_type_to_topology_class(metal_primitive_type_); has_begun_ = true; + /* If prim type is line loop, add an extra vertex at the end for placing the closing line, + * as metal does not support this primitive type. We treat this as a Line strip with one + * extra value. */ + int vertex_alloc_length = vertex_len; + if (prim_type == GPU_PRIM_LINE_LOOP) { +vertex_alloc_length++; + } + /* Allocate a range of data and return host-accessible pointer. */ - const size_t bytes_needed = vertex_buffer_size(&vertex_format, vertex_len); + const size_t bytes_needed = vertex_buffer_size(&vertex_format, vertex_alloc_length); current_allocation_ = context_->get_scratchbuffer_manager() .scratch_buffer_allocate_range_aligned(bytes_needed, 256); [current_allocation_.metal_buffer retain]; @@ -266,71 +274,88 @@ void MTLImmediate::end() * For immediate mode, generating these is currently very cheap, as we use * fast scratch buffer allocations. Though we may benefit from caching of * frequently used buffer sizes. */ + bool rendered = false; if (mtl_needs_topology_emulation(this->prim_type)) { -/* Debug safety check for SSBO FETCH MODE. */ -if (active_mtl_shader->get_uses_ssbo_vertex_fetch()) { - BLI_assert(false && "Topology emulation not supported with SSBO Vertex Fetch mode"); -} - /* Emulate Tri-fan. */ -if (this->prim_type == GPU_PRIM_TRI_FAN) { - /* Prepare Triangle-Fan emulation index buffer on CPU based on number of input - * vertices. */ - uint32_t base_vert_count = this->vertex_idx; - uint32_t num_triangles = max_ii(base_vert_count - 2, 0); - uint32_t fan_index_count = num_triangles * 3; - BLI_assert(num_triangles > 0); - - uint32_t alloc_size = sizeof(uint32_t) * fan_index_count; - uint32_t *index_buffer = nullptr; - - MTLTemporaryBuffer allocation = - context_->get_scratchbuffer_manager().scratch_buffer_allocate_range_aligned( - alloc_size, 128); - index_buffer = (uint32_t *)allocation.data; - - int a = 0; - for (int i = 0; i < num_triangles; i++) { -index_buffer[a++] = 0; -index_buffer[a++] = i + 1; -index_buffer[a++] = i + 2; - } +switch (this->prim_type) { + case GPU_PRIM_TRI_FAN: { +/* Debug safety check for SSBO FETCH MODE. */ +if (active_mtl_shader->get_uses_ssbo_vertex_fetch()) { + BLI_assert( + false && + "Topology emulation for TriangleFan not supported with SSBO Vertex Fetch mode"); +} - @autoreleasepool { +/* Prepare Triangle-Fan emulation index buffer on CPU based on number of input + * vertices. */ +uint32_t base_vert_count = this->vertex_idx; +uint32_t num_triangles = max_ii(base_vert_count - 2, 0); +uint32_t fan_index_count = num_triangles * 3; +BLI_assert(num_triangles > 0); + +uint32_t alloc_size = sizeof(uint32_t) * fan_index_count; +uint32_t *index_buffer = nullptr; + +MTLTemporaryBuffer allocation = + context_->get_scratchbuffer_manager().scratch_buffer_allocate_range_aligned( +alloc_size, 128); +index_buffer = (uint32_t *)allocation.data; + +int a = 0; +for (int i = 0; i < num_triangles; i++) { + index_buffer[a++] = 0; + index_buffer[a++] = i + 1; + index_buffer[a++] = i + 2; +} -id index_buffer_mtl = nil; -uint32_t index_buffer_
[Bf-blender-cvs] [2712265598a] master: Metal: Addressing a number of small outstanding issues across Metal backend.
Commit: 2712265598a09c3868b9d097488f22d42efbf6eb Author: Jason Fielder Date: Tue Dec 20 14:03:22 2022 +0100 Branches: master https://developer.blender.org/rB2712265598a09c3868b9d097488f22d42efbf6eb Metal: Addressing a number of small outstanding issues across Metal backend. - Support for non-contiguous shader resource bindings for all cases required by create-info - Implement missing geometry shader alternative path for edit curve handle. - Add support for non-float dummy textures to address all cases where default bindings may be required. Authored by Apple: Michael Parkin-White Ref T96261 Depends on D16721 Reviewed By: fclem Differential Revision: https://developer.blender.org/D16777 === M source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh M source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl M source/blender/gpu/intern/gpu_shader_create_info.cc M source/blender/gpu/intern/gpu_texture_private.hh M source/blender/gpu/metal/mtl_batch.mm M source/blender/gpu/metal/mtl_context.hh M source/blender/gpu/metal/mtl_context.mm M source/blender/gpu/metal/mtl_drawlist.mm M source/blender/gpu/metal/mtl_framebuffer.mm M source/blender/gpu/metal/mtl_immediate.mm M source/blender/gpu/metal/mtl_pso_descriptor_state.hh M source/blender/gpu/metal/mtl_shader.mm M source/blender/gpu/metal/mtl_shader_generator.hh M source/blender/gpu/metal/mtl_shader_generator.mm M source/blender/gpu/metal/mtl_shader_interface.hh M source/blender/gpu/metal/mtl_shader_interface.mm M source/blender/gpu/metal/mtl_shader_interface_type.hh M source/blender/gpu/metal/mtl_texture.mm M source/blender/gpu/metal/mtl_vertex_buffer.hh M source/blender/imbuf/intern/util_gpu.c === diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh index 3e0492d024c..b1c28bcb3e3 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh @@ -397,8 +397,8 @@ GPU_SHADER_CREATE_INFO(overlay_edit_curve_handle_no_geom) /* NOTE: Color already in Linear space. Which is what we want. */ .define("srgbTarget", "false") .vertex_in(0, Type::VEC3, "pos") -.vertex_in(1, Type::UINT, "data") -.vertex_out(overlay_edit_curve_handle_iface) +.vertex_in(1, Type::UCHAR, "data") +.vertex_out(overlay_edit_smooth_color_iface) .push_constant(Type::BOOL, "showCurveHandles") .push_constant(Type::INT, "curveHandleDisplay") .fragment_out(0, Type::VEC4, "fragColor") diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl index 8b4b7afb996..518b98e4ce5 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl @@ -1,16 +1,166 @@ -/* TODO(Metal): Implement correct SSBO implementation for geom shader workaround. - * Currently included as placeholder to unblock failing compilation in Metal. */ #pragma BLENDER_REQUIRE(common_view_clipping_lib.glsl) #pragma BLENDER_REQUIRE(common_view_lib.glsl) +#pragma USE_SSBO_VERTEX_FETCH(TriangleStrip, 10) + +#define DISCARD_VERTEX \ + gl_Position = vec4(0.0); \ + finalColor = vec4(0.0); \ + return; + +void output_line(vec2 offset, vec4 color, vec3 out_world_pos, vec4 out_ndc_pos) +{ + finalColor = color; + gl_Position = out_ndc_pos; + gl_Position.xy += offset * out_ndc_pos.w; + view_clipping_distances(out_world_pos); +} void main() { GPU_INTEL_VERTEX_SHADER_WORKAROUND - vec3 world_pos = point_object_to_world(pos); - gl_Position = point_world_to_ndc(world_pos); - vert.flag = data; + /* Perform vertex shader for each input primitive. */ + vec3 in_pos[2]; + vec3 world_pos[2]; + vec4 ndc_pos[2]; + uint vert_flag[2]; + + /* Input prim is LineList. */ + /* Index of the input line primitive. */ + int input_line_id = gl_VertexID / 10; + /* Index of output vertex set. Grouped into pairs as outputted by original "output_line" function + * in overlay_edit_curve_handle_geom.glsl. */ + int output_prim_id = (gl_VertexID / 2) % 5; + /* ID of vertex within line primitive (0 or 1) for current vertex. */ + int output_prim_vert_id = gl_VertexID % 2; + + for (int i = 0; i < 2; i++) { +in_pos[i] = vertex_fetch_attribute((input_line_id * 2) + i, pos, vec3).xyz; +vert_flag[i] = (uint)vertex_fetch_attribute((input_line_id * 2) + i, data, uchar); +world_pos[i] = point_object_to_wor
[Bf-blender-cvs] [6d397bc3996] temp-xr-painting: Experiment to read the brush location from a helper object.
Commit: 6d397bc3996c6233fd09065fae7c8014ea86dce2 Author: Jeroen Bakker Date: Tue Dec 20 13:44:28 2022 +0100 Branches: temp-xr-painting https://developer.blender.org/rB6d397bc3996c6233fd09065fae7c8014ea86dce2 Experiment to read the brush location from a helper object. Many functionality is based on mouse positions so in order to work the mouse still needs to move, otherwise steps aren't updated. === M source/blender/blenkernel/BKE_paint.h M source/blender/editors/sculpt_paint/sculpt.cc M source/blender/editors/sculpt_paint/sculpt_detail.c M source/blender/editors/sculpt_paint/sculpt_intern.h === diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 5c878486c68..3fd63b42b95 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -663,6 +663,7 @@ typedef struct SculptSession { float cursor_normal[3]; float cursor_sampled_normal[3]; float cursor_view_normal[3]; + struct Object *brush_object; /* For Sculpt trimming gesture tools, initial ray-cast data from the position of the mouse * when diff --git a/source/blender/editors/sculpt_paint/sculpt.cc b/source/blender/editors/sculpt_paint/sculpt.cc index 9cb30c9f83d..723a707fa4a 100644 --- a/source/blender/editors/sculpt_paint/sculpt.cc +++ b/source/blender/editors/sculpt_paint/sculpt.cc @@ -14,9 +14,12 @@ #include "BLI_blenlib.h" #include "BLI_dial_2d.h" +#include "BLI_float4x4.hh" #include "BLI_ghash.h" #include "BLI_gsqueue.h" #include "BLI_math.h" +#include "BLI_math_vec_types.hh" +#include "BLI_math_vector.hh" #include "BLI_task.h" #include "BLI_task.hh" #include "BLI_timeit.hh" @@ -4960,8 +4963,88 @@ static void sculpt_find_nearest_to_ray_cb(PBVHNode *node, void *data_v, float *t } } +void SCULPT_raycaster_init_from_mouse(ViewContext *vc, + const float mval[2], + SculptRaycaster *r_raycaster) +{ + r_raycaster->object = nullptr; + copy_v2_v2(r_raycaster->mouse, mval); +} + +void SCULPT_raycaster_init_from_object(Object *object, SculptRaycaster *r_raycaster) +{ + r_raycaster->object = object; + zero_v2(r_raycaster->mouse); +} + +void SCULPT_raycaster_init(ViewContext *vc, const float mval[2], SculptRaycaster *r_raycaster) +{ + Object *ob = vc->obact; + SculptSession *ss = ob->sculpt; + if (ss->brush_object) { +SCULPT_raycaster_init_from_object(ss->brush_object, r_raycaster); + } + else { +SCULPT_raycaster_init_from_mouse(vc, mval, r_raycaster); + } +} + +static void sculpt_ray_init(blender::float3 position, +blender::float3 direction, +float length, +SculptRay *r_ray) +{ + copy_v3_v3(r_ray->position, position); + copy_v3_v3(r_ray->direction, direction); + r_ray->length = length; +} + +static void sculpt_raycaster_cast_ray_from_object(const SculptRaycaster *raycaster, + ViewContext *vc, + SculptRay *r_ray) +{ + blender::float4x4 mat(raycaster->object->object_to_world); + blender::float3 start_position = mat * blender::float3(0.0f); + blender::float3 end_position = mat * blender::float3(0.0f, 0.0f, 1.0f); + /* Don't clip start of the ray to the view bounds as a raycaster doesn't start at the view + * bounds, unline the mouse cursor. */ + blender::float3 start_position_dummy(start_position); + ED_view3d_clip_segment( + static_cast(vc->region->regiondata), start_position_dummy, end_position); + sculpt_ray_init(start_position, + blender::math::normalize(end_position - start_position), + blender::math::length(end_position - start_position), + r_ray); +} + +static void sculpt_raycaster_cast_ray_from_mouse(const SculptRaycaster *raycaster, + ViewContext *vc, + SculptRay *r_ray) +{ + blender::float3 start_position; + blender::float3 end_position; + ED_view3d_win_to_segment_clipped( + vc->depsgraph, vc->region, vc->v3d, raycaster->mouse, start_position, end_position, true); + sculpt_ray_init(start_position, + blender::math::normalize(end_position - start_position), + blender::math::length(end_position - start_position), + r_ray); +} + +static void sculpt_raycaster_cast_ray(const SculptRaycaster *raycaster, + ViewContext *vc, + SculptRay *r_ray) +{ + if (raycaster->object) { +sculpt_raycaster_cast_ray_from_object(raycaster, vc, r_ray); + } + else { +sculpt_raycaster_cast_ray_from_mouse(raycaster, vc, r_ray); + } +
[Bf-blender-cvs] [1e1defc3755] temp-xr-painting: Fix openxr using windows mixed reality + AMD vega 64.
Commit: 1e1defc375540cdd68d904804739ef75c9e6729c Author: Jeroen Bakker Date: Mon Dec 19 15:42:24 2022 +0100 Branches: temp-xr-painting https://developer.blender.org/rB1e1defc375540cdd68d904804739ef75c9e6729c Fix openxr using windows mixed reality + AMD vega 64. === M intern/ghost/intern/GHOST_ContextD3D.cpp === diff --git a/intern/ghost/intern/GHOST_ContextD3D.cpp b/intern/ghost/intern/GHOST_ContextD3D.cpp index 53bb73ba258..ce56aa8b3ed 100644 --- a/intern/ghost/intern/GHOST_ContextD3D.cpp +++ b/intern/ghost/intern/GHOST_ContextD3D.cpp @@ -258,7 +258,7 @@ class GHOST_SharedOpenGLResource { glGenRenderbuffers(1, &m_gl_render_target); glBindRenderbuffer(GL_RENDERBUFFER, m_gl_render_target); -if (!reregisterSharedObject(TARGET_RENDERBUF)) { +if (false && !reregisterSharedObject(TARGET_RENDERBUF)) { glBindRenderbuffer(GL_RENDERBUFFER, 0); if (m_gl_render_target) { glDeleteRenderbuffers(1, &m_gl_render_target); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c76d4ddf0bf] tmp-workbench-rewrite2: Cleanup comments
Commit: c76d4ddf0bf1358c0142a8212f3b0d3e567aebc2 Author: Miguel Pozo Date: Mon Dec 19 16:27:29 2022 +0100 Branches: tmp-workbench-rewrite2 https://developer.blender.org/rBc76d4ddf0bf1358c0142a8212f3b0d3e567aebc2 Cleanup comments === M source/blender/draw/engines/workbench/shaders/workbench_shadow_visibility_comp.glsl M source/blender/draw/engines/workbench/workbench_effect_cavity.cc M source/blender/draw/engines/workbench/workbench_effect_dof.cc M source/blender/draw/engines/workbench/workbench_effect_outline.cc M source/blender/draw/engines/workbench/workbench_materials_next.cc M source/blender/draw/engines/workbench/workbench_private.hh M source/blender/draw/engines/workbench/workbench_resources.cc M source/blender/draw/engines/workbench/workbench_shadow.cc M source/blender/draw/engines/workbench/workbench_state.cc === diff --git a/source/blender/draw/engines/workbench/shaders/workbench_shadow_visibility_comp.glsl b/source/blender/draw/engines/workbench/shaders/workbench_shadow_visibility_comp.glsl index e638e68c80f..aef73672a8a 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_shadow_visibility_comp.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_shadow_visibility_comp.glsl @@ -1,9 +1,4 @@ -/** - * Compute visibility of each resource bounds for a given view. - */ -/* TODO(fclem): This could be augmented by a 2 pass occlusion culling system. */ - #pragma BLENDER_REQUIRE(common_math_lib.glsl) #pragma BLENDER_REQUIRE(common_intersect_lib.glsl) diff --git a/source/blender/draw/engines/workbench/workbench_effect_cavity.cc b/source/blender/draw/engines/workbench/workbench_effect_cavity.cc index c0ee7fd60c2..a87c0fa2ba1 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_cavity.cc +++ b/source/blender/draw/engines/workbench/workbench_effect_cavity.cc @@ -1,5 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later - * Copyright 2020 Blender Foundation. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /** \file * \ingroup draw_engine diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.cc b/source/blender/draw/engines/workbench/workbench_effect_dof.cc index e5282166c26..25b0c6de74e 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_dof.cc +++ b/source/blender/draw/engines/workbench/workbench_effect_dof.cc @@ -1,5 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later - * Copyright 2016 Blender Foundation. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /** \file * \ingroup draw_engine diff --git a/source/blender/draw/engines/workbench/workbench_effect_outline.cc b/source/blender/draw/engines/workbench/workbench_effect_outline.cc index 4a060153618..18b8b484aef 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_outline.cc +++ b/source/blender/draw/engines/workbench/workbench_effect_outline.cc @@ -1,5 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later - * Copyright 2020 Blender Foundation. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /** \file * \ingroup draw_engine diff --git a/source/blender/draw/engines/workbench/workbench_materials_next.cc b/source/blender/draw/engines/workbench/workbench_materials_next.cc index 6e4085b584e..ec42c696ccc 100644 --- a/source/blender/draw/engines/workbench/workbench_materials_next.cc +++ b/source/blender/draw/engines/workbench/workbench_materials_next.cc @@ -4,10 +4,9 @@ #include "BLI_hash.h" /* get_image */ +#include "BKE_node.h" #include "DNA_node_types.h" #include "ED_uvedit.h" -//#include "BKE_image.h" -#include "BKE_node.h" /* get_image */ namespace blender::workbench { diff --git a/source/blender/draw/engines/workbench/workbench_private.hh b/source/blender/draw/engines/workbench/workbench_private.hh index b0f3ad2..9173cc089c7 100644 --- a/source/blender/draw/engines/workbench/workbench_private.hh +++ b/source/blender/draw/engines/workbench/workbench_private.hh @@ -119,8 +119,8 @@ class CavityEffect { bool curvature_enabled_; bool cavity_enabled_; - static const int max_samples_ = 512; // This value must be kept in sync with the one declared at -// workbench_composite_info.hh (cavity_samples) + static const int max_samples_ = 512; /* This value must be kept in sync with the one declared at +* workbench_composite_info.hh (cavity_samples) */ UniformArrayBuffer samples_buf; void load_samples_buf(int ssao_samples); @@ -253,7 +253,6 @@ class ShadowPass { UniformBuffer extruded_frustum_; ShadowPass::PassType current_pass_type_; -/* TODO(Miguel Pozo): Use multiple views? */ VisibilityBuf pass_visibility_buf_; VisibilityBuf fail_visibility_buf_; diff --git a/source/blender/draw/engines/workbench/workbench
[Bf-blender-cvs] [844b6e39826] master: Nodes: use CacheMutex to protect topology cache
Commit: 844b6e39826ff62334705307b1e5cc1eb286d298 Author: Jacques Lucke Date: Tue Dec 20 13:05:02 2022 +0100 Branches: master https://developer.blender.org/rB844b6e39826ff62334705307b1e5cc1eb286d298 Nodes: use CacheMutex to protect topology cache No functional changes are expected. === M source/blender/blenkernel/BKE_node_runtime.hh M source/blender/blenkernel/intern/node.cc M source/blender/blenkernel/intern/node_runtime.cc M source/blender/blenkernel/intern/node_tree_update.cc === diff --git a/source/blender/blenkernel/BKE_node_runtime.hh b/source/blender/blenkernel/BKE_node_runtime.hh index b4b9df32663..4ecc82b7fc3 100644 --- a/source/blender/blenkernel/BKE_node_runtime.hh +++ b/source/blender/blenkernel/BKE_node_runtime.hh @@ -5,6 +5,7 @@ #include #include +#include "BLI_cache_mutex.hh" #include "BLI_multi_value_map.hh" #include "BLI_utility_mixins.hh" #include "BLI_vector.hh" @@ -119,9 +120,8 @@ class bNodeTreeRuntime : NonCopyable, NonMovable { * Protects access to all topology cache variables below. This is necessary so that the cache can * be updated on a const #bNodeTree. */ - std::mutex topology_cache_mutex; - bool topology_cache_is_dirty = true; - bool topology_cache_exists = false; + CacheMutex topology_cache_mutex; + std::atomic topology_cache_exists = false; /** * Under some circumstances, it can be useful to use the cached data while editing the * #bNodeTree. By default, this is protected against using an assert. @@ -298,7 +298,7 @@ inline bool topology_cache_is_available(const bNodeTree &tree) if (tree.runtime->allow_use_dirty_topology_cache.load() > 0) { return true; } - if (tree.runtime->topology_cache_is_dirty) { + if (tree.runtime->topology_cache_mutex.is_dirty()) { return false; } return true; diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 84bf186367b..66c90745110 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -2010,7 +2010,7 @@ bNode *nodeFindNodebyName(bNodeTree *ntree, const char *name) void nodeFindNode(bNodeTree *ntree, bNodeSocket *sock, bNode **r_node, int *r_sockindex) { *r_node = nullptr; - if (!ntree->runtime->topology_cache_is_dirty) { + if (ntree->runtime->topology_cache_mutex.is_cached()) { bNode *node = &sock->owner_node(); *r_node = node; if (r_sockindex) { diff --git a/source/blender/blenkernel/intern/node_runtime.cc b/source/blender/blenkernel/intern/node_runtime.cc index 0f0b04f920e..642dfcc0490 100644 --- a/source/blender/blenkernel/intern/node_runtime.cc +++ b/source/blender/blenkernel/intern/node_runtime.cc @@ -22,26 +22,6 @@ void preprocess_geometry_node_tree_for_evaluation(bNodeTree &tree_cow) blender::nodes::ensure_geometry_nodes_lazy_function_graph(tree_cow); } -static void double_checked_lock(std::mutex &mutex, bool &data_is_dirty, FunctionRef fn) -{ - if (!data_is_dirty) { -return; - } - std::lock_guard lock{mutex}; - if (!data_is_dirty) { -return; - } - fn(); - data_is_dirty = false; -} - -static void double_checked_lock_with_task_isolation(std::mutex &mutex, -bool &data_is_dirty, -FunctionRef fn) -{ - double_checked_lock(mutex, data_is_dirty, [&]() { threading::isolate_task(fn); }); -} - static void update_interface_sockets(const bNodeTree &ntree) { bNodeTreeRuntime &tree_runtime = *ntree.runtime; @@ -434,37 +414,34 @@ static void update_group_output_node(const bNodeTree &ntree) static void ensure_topology_cache(const bNodeTree &ntree) { bNodeTreeRuntime &tree_runtime = *ntree.runtime; - double_checked_lock_with_task_isolation( - tree_runtime.topology_cache_mutex, tree_runtime.topology_cache_is_dirty, [&]() { -update_interface_sockets(ntree); -update_node_vector(ntree); -update_link_vector(ntree); -update_socket_vectors_and_owner_node(ntree); -update_internal_link_inputs(ntree); -update_directly_linked_links_and_sockets(ntree); -threading::parallel_invoke( -tree_runtime.nodes_by_id.size() > 32, -[&]() { update_logical_origins(ntree); }, -[&]() { update_nodes_by_type(ntree); }, -[&]() { update_sockets_by_identifier(ntree); }, -[&]() { - update_toposort(ntree, - ToposortDirection::LeftToRight, - tree_runtime.toposort_left_to_right, - tree_runtime.has_available_link_cycle); -}, -[&]() { - bool dummy; - update_toposort(ntree, - ToposortDirection::RightToLeft, -
[Bf-blender-cvs] [5e21a0909c7] microfacet_hair: Cleanup: formatting and `fast_sincosf()` call
Commit: 5e21a0909c7a9b0ba3201771ae25136db4a2438d Author: Weizhen Huang Date: Tue Dec 20 12:05:35 2022 +0100 Branches: microfacet_hair https://developer.blender.org/rB5e21a0909c7a9b0ba3201771ae25136db4a2438d Cleanup: formatting and `fast_sincosf()` call === M intern/cycles/kernel/closure/bsdf_hair_microfacet.h === diff --git a/intern/cycles/kernel/closure/bsdf_hair_microfacet.h b/intern/cycles/kernel/closure/bsdf_hair_microfacet.h index 05d9917dcd7..32a163eb846 100644 --- a/intern/cycles/kernel/closure/bsdf_hair_microfacet.h +++ b/intern/cycles/kernel/closure/bsdf_hair_microfacet.h @@ -141,10 +141,9 @@ ccl_device_inline float2 dir_sph(const float3 w) /* Compute the vector direction given spherical coordinates */ ccl_device_inline float3 sph_dir(float theta, float gamma) { - float sin_theta = sinf(theta); - float cos_theta = cosf(theta); - float sin_gamma = sinf(gamma); - float cos_gamma = cosf(gamma); + float sin_theta, cos_theta, sin_gamma, cos_gamma; + fast_sincosf(theta, &sin_theta, &cos_theta); + fast_sincosf(gamma, &sin_gamma, &cos_gamma); return make_float3(sin_gamma * cos_theta, sin_theta, cos_gamma * cos_theta); } @@ -153,38 +152,35 @@ ccl_device_inline float3 sph_dir(float theta, float gamma) /* Conversion between gamma and phi. Notations see Figure 5 in the paper. */ ccl_device float to_phi(float gamma, float a, float b) { - float sin_gamma = sinf(gamma); - float cos_gamma = cosf(gamma); + float sin_gamma, cos_gamma; + fast_sincosf(gamma, &sin_gamma, &cos_gamma); return atan2f(b * sin_gamma, a * cos_gamma); } ccl_device float to_gamma(float phi, float a, float b) { - float sin_phi = sinf(phi); - float cos_phi = cosf(phi); + float sin_phi, cos_phi; + fast_sincosf(phi, &sin_phi, &cos_phi); return atan2f(a * sin_phi, b * cos_phi); } /* Compute the coordinate on the ellipse, given gamma, the semi-major and semi-minor axes. */ ccl_device float2 to_point(float gamma, float a, float b) { - float sin_gamma = sinf(gamma); - float cos_gamma = cosf(gamma); + float sin_gamma, cos_gamma; + fast_sincosf(gamma, &sin_gamma, &cos_gamma); return make_float2(a * sin_gamma, b * cos_gamma); } /* Compute the vector direction given by theta and gamma. */ ccl_device float3 sphg_dir(float theta, float gamma, float a, float b) { - float sin_theta = sinf(theta); - float cos_theta = cosf(theta); - float sin_gamma = sinf(gamma); - float cos_gamma = cosf(gamma); + float sin_theta, cos_theta, sin_gamma, cos_gamma; + fast_sincosf(theta, &sin_theta, &cos_theta); + fast_sincosf(gamma, &sin_gamma, &cos_gamma); float tan_gamma = sin_gamma / cos_gamma; float tan_phi = b / a * tan_gamma; - float cos_phi = 1.0f / sqrtf(sqr(tan_phi) + 1.0f); - if (cos_gamma < 0.0f) -cos_phi = -cos_phi; + float cos_phi = signf(cos_gamma) / sqrtf(sqr(tan_phi) + 1.0f); float sin_phi = cos_phi * tan_phi; return make_float3(sin_phi * cos_theta, sin_theta, cos_phi * cos_theta); } @@ -368,8 +364,8 @@ ccl_device float3 bsdf_microfacet_hair_eval_r_circular(ccl_private const ShaderC const float roughness_squared = roughness * roughness; -const float sm = sinf(tilt); -const float cm = cosf(tilt); +float sm, cm; +fast_sincosf(tilt, &sm, &cm); const float C = sqrtf(1.0f - roughness_squared); const float A = cm * cos_theta(wh) * C; @@ -379,10 +375,9 @@ ccl_device float3 bsdf_microfacet_hair_eval_r_circular(ccl_private const ShaderC const float tmp1 = 1.0f / sqrtf(sqr(B - 1.0f) - A2); const float tmp2 = 1.0f / sqrtf(sqr(B + 1.0f) - A2); -const float smax = sinf(d_max); -const float cmax = cosf(d_max); -const float smin = sinf(d_min); -const float cmin = cosf(d_min); +float smax, cmax, smin, cmin; +fast_sincosf(d_max, &smax, &cmax); +fast_sincosf(d_min, &smin, &cmin); const float tmax = smax / (1.0f + cmax); const float tmin = smin / (1.0f + cmin); @@ -492,8 +487,9 @@ ccl_device float3 bsdf_microfacet_hair_eval_tt_trt_circular(KernelGlobals kg, const float3 wmt = sph_dir(-tilt, phi_mt); const float G1 = G(beckmann, roughness, wi, -wt, wmi, wh1); -if (G1 == 0.0f || !microfacet_visible(wi, -wt, make_float3(wmi.x, 0.0f, wmi.z), wh1)) +if (G1 == 0.0f || !microfacet_visible(wi, -wt, make_float3(wmi.x, 0.0f, wmi.z), wh1)) { continue; +} /* Simpson's rule weight */ float weight = (i == 0 || i == intervals - 1) ? 0.5f : (i % 2 + 1); @@ -546,13 +542,14 @@ ccl_device float3 bsdf_microfacet_hair_eval_tt_trt_circular(KernelGlobals kg, float3 wtr = -reflect(wt, wh2); float G2 = G(beckmann, roughness, -wt, -wtr, wmt, wh2); - if (G2 == 0.0f || - microfacet_visible(-wt, -wtr, make_float3(wmt.x, 0.0f, wmt.z), wh2) == 0.0f) + if (G2 == 0.0f || !microfacet_visible(-wt, -wtr, make_float3(wmt.x,
[Bf-blender-cvs] [90e4c8436d2] blender-v2.93-release: Updating submodule hash before tagging Blender 2.93.12
Commit: 90e4c8436d24519e5f3a2dd11dac000be1bfcb5c Author: Thomas Dinges Date: Tue Dec 20 11:41:27 2022 +0100 Branches: blender-v2.93-release https://developer.blender.org/rB90e4c8436d24519e5f3a2dd11dac000be1bfcb5c Updating submodule hash before tagging Blender 2.93.12 === M release/scripts/addons === diff --git a/release/scripts/addons b/release/scripts/addons index ce25c08d472..f0dd4aaf880 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit ce25c08d472f9f7d295b1735b1b6c321a4fc2a13 +Subproject commit f0dd4aaf8800ce48e589f8e35403d6aa687b16ed ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ef9ca44dee7] blender-v3.4-release: Update submodule hashes before tagging Blender 3.4.1 release.
Commit: ef9ca44dee7fe3e25089dbfc49c69e9eff83ba5a Author: Thomas Dinges Date: Tue Dec 20 09:50:50 2022 +0100 Branches: blender-v3.4-release https://developer.blender.org/rBef9ca44dee7fe3e25089dbfc49c69e9eff83ba5a Update submodule hashes before tagging Blender 3.4.1 release. === M release/scripts/addons M release/scripts/addons_contrib === diff --git a/release/scripts/addons b/release/scripts/addons index b83a135675f..7408fc7283f 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit b83a135675f2e9b4b9cd7923d86c3afb0f1fce1b +Subproject commit 7408fc7283fd98a88db1383f45f5d15680472a7f diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 69b1305f4b7..886ea86bd9a 16 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 69b1305f4b74fbd7e847acc6a5566755b9803d78 +Subproject commit 886ea86bd9a0fd2761260a46356b728d51f2298a ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [105c0aa5b6d] master: Fix T103064: Realtime Compositor crashes on undo
Commit: 105c0aa5b6dea92751e6ee459d91a79f7d6b2240 Author: Omar Emara Date: Tue Dec 20 10:09:25 2022 +0200 Branches: master https://developer.blender.org/rB105c0aa5b6dea92751e6ee459d91a79f7d6b2240 Fix T103064: Realtime Compositor crashes on undo The Realtime Compositor crashes on undo after an operation like Dissolve node. The compositor evaluator stored a reference to the compositor node tree assuming that it will always be valid. This is not guaranteed, however, and changes to the node tree can invalidate that reference. So we get the node tree from the context directly every time to fix the crash. === M source/blender/compositor/realtime_compositor/COM_evaluator.hh M source/blender/compositor/realtime_compositor/intern/evaluator.cc M source/blender/draw/engines/compositor/compositor_engine.cc === diff --git a/source/blender/compositor/realtime_compositor/COM_evaluator.hh b/source/blender/compositor/realtime_compositor/COM_evaluator.hh index 258a2a038c4..c8e953da268 100644 --- a/source/blender/compositor/realtime_compositor/COM_evaluator.hh +++ b/source/blender/compositor/realtime_compositor/COM_evaluator.hh @@ -102,8 +102,9 @@ class Evaluator { private: /* A reference to the compositor context. */ Context &context_; - /* A reference to the compositor node tree. */ - bNodeTree &node_tree_; + /* A derived node tree representing the compositor node tree. This is constructed when the node + * tree is compiled and reset when the evaluator is reset, so it gets reconstructed every time + * the node tree changes. */ std::unique_ptr derived_node_tree_; /* The compiled operations stream. This contains ordered pointers to the operations that were * compiled. This is initialized when the node tree is compiled and freed when the evaluator @@ -116,8 +117,8 @@ class Evaluator { bool is_compiled_ = false; public: - /* Construct an evaluator from a compositor node tree and a context. */ - Evaluator(Context &context, bNodeTree &node_tree); + /* Construct an evaluator from a context. */ + Evaluator(Context &context); /* Evaluate the compositor node tree. If the node tree is already compiled into an operations * stream, that stream will be evaluated directly. Otherwise, the node tree will be compiled and diff --git a/source/blender/compositor/realtime_compositor/intern/evaluator.cc b/source/blender/compositor/realtime_compositor/intern/evaluator.cc index 1cd7d4f8951..1b52e1d381d 100644 --- a/source/blender/compositor/realtime_compositor/intern/evaluator.cc +++ b/source/blender/compositor/realtime_compositor/intern/evaluator.cc @@ -21,8 +21,7 @@ namespace blender::realtime_compositor { using namespace nodes::derived_node_tree_types; -Evaluator::Evaluator(Context &context, bNodeTree &node_tree) -: context_(context), node_tree_(node_tree) +Evaluator::Evaluator(Context &context) : context_(context) { } @@ -67,7 +66,7 @@ bool Evaluator::validate_node_tree() void Evaluator::compile_and_evaluate() { - derived_node_tree_ = std::make_unique(node_tree_); + derived_node_tree_ = std::make_unique(*context_.get_scene()->nodetree); if (!validate_node_tree()) { return; diff --git a/source/blender/draw/engines/compositor/compositor_engine.cc b/source/blender/draw/engines/compositor/compositor_engine.cc index 3b7378f280b..03ef0be81b4 100644 --- a/source/blender/draw/engines/compositor/compositor_engine.cc +++ b/source/blender/draw/engines/compositor/compositor_engine.cc @@ -90,7 +90,7 @@ class Engine { public: Engine(char *info_message) : context_(texture_pool_, info_message), -evaluator_(context_, node_tree()), +evaluator_(context_), last_viewport_size_(context_.get_output_size()) { } @@ -124,12 +124,6 @@ class Engine { evaluator_.reset(); } } - - /* Get a reference to the compositor node tree. */ - static bNodeTree &node_tree() - { -return *DRW_context_state_get()->scene->nodetree; - } }; } // namespace blender::draw::compositor ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs