[Bf-blender-cvs] [46e049d0ce2] master: BLI: Refactor vector types & functions to use templates

Clment Foucault noreply at git.blender.org
Wed Jan 12 12:47:46 CET 2022


Commit: 46e049d0ce2bce2f53ddc41a0dbbea2969d00a5d
Author: Clment Foucault
Date:   Wed Jan 12 12:46:52 2022 +0100
Branches: master
https://developer.blender.org/rB46e049d0ce2bce2f53ddc41a0dbbea2969d00a5d

BLI: Refactor vector types & functions to use templates

This patch implements the vector types (i.e:`float2`) by making heavy
usage of templating. All vector functions are now outside of the vector
classes (inside the `blender::math` namespace) and are not vector size
dependent for the most part.

In the ongoing effort to make shaders less GL centric, we are aiming
to share more code between GLSL and C++ to avoid code duplication.

####Motivations:
 - We are aiming to share UBO and SSBO structures between GLSL and C++.
 This means we will use many of the existing vector types and others
 we currently don't have (uintX, intX). All these variations were
 asking for many more code duplication.
 - Deduplicate existing code which is duplicated for each vector size.
 - We also want to share small functions. Which means that vector
 functions should be static and not in the class namespace.
 - Reduce friction to use these types in new projects due to their
 incompleteness.
 - The current state of the `BLI_(float|double|mpq)(2|3|4).hh` is a
 bit of a let down. Most clases are incomplete, out of sync with each
 others with different codestyles, and some functions that should be
 static are not (i.e: `float3::reflect()`).

####Upsides:
 - Still support `.x, .y, .z, .w` for readability.
 - Compact, readable and easilly extendable.
 - All of the vector functions are available for all the vectors types
 and can be restricted to certain types. Also template specialization
 let us define exception for special class (like mpq).
 - With optimization ON, the compiler unroll the loops and performance
 is the same.

####Downsides:
 - Might impact debugability. Though I would arge that the bugs are
 rarelly caused by the vector class itself (since the operations are
 quite trivial) but by the type conversions.
 - Might impact compile time. I did not saw a significant impact since
 the usage is not really widespread.
 - Functions needs to be rewritten to support arbitrary vector length.
 For instance, one can't call `len_squared_v3v3` in
 `math::length_squared()` and call it a day.
 - Type cast does not work with the template version of the `math::`
 vector functions. Meaning you need to manually cast `float *` and
 `(float *)[3]` to `float3` for the function calls.
 i.e: `math::distance_squared(float3(nearest.co), positions[i]);`
 - Some parts might loose in readability:
 `float3::dot(v1.normalized(), v2.normalized())`
 becoming
 `math::dot(math::normalize(v1), math::normalize(v2))`
 But I propose, when appropriate, to use
 `using namespace blender::math;` on function local or file scope to
 increase readability.
 `dot(normalize(v1), normalize(v2))`

####Consideration:
 - Include back `.length()` method. It is quite handy and is more C++
 oriented.
 - I considered the GLM library as a candidate for replacement. It felt
 like too much for what we need and would be difficult to extend / modify
 to our needs.
 - I used Macros to reduce code in operators declaration and potential
 copy paste bugs. This could reduce debugability and could be reverted.
 - This touches `delaunay_2d.cc` and the intersection code. I would like
 to know @howardt opinion on the matter.
 - The `noexcept` on the copy constructor of `mpq(2|3)` is being removed.
 But according to @JacquesLucke it is not a real problem for now.

I would like to give a huge thanks to @JacquesLucke who helped during this
and pushed me to reduce the duplication further.

Reviewed By: brecht, sergey, JacquesLucke

Differential Revision: https://developer.blender.org/D13791

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

M	CMakeLists.txt
M	build_files/build_environment/cmake/gmp.cmake
M	build_files/build_environment/cmake/versions.cmake
M	build_files/cmake/macros.cmake
M	build_files/cmake/platform/platform_unix.cmake
M	extern/hipew/src/hipew.c
M	intern/ghost/GHOST_Types.h
M	release/scripts/addons
M	release/scripts/startup/bl_operators/clip.py
M	source/blender/blenfont/BLF_api.h
M	source/blender/blenfont/intern/blf_internal.h
M	source/blender/blenkernel/BKE_appdir.h
M	source/blender/blenkernel/BKE_attribute.h
M	source/blender/blenkernel/BKE_attribute_access.hh
M	source/blender/blenkernel/BKE_attribute_math.hh
M	source/blender/blenkernel/BKE_bvhutils.h
M	source/blender/blenkernel/BKE_customdata.h
M	source/blender/blenkernel/BKE_geometry_set.hh
M	source/blender/blenkernel/BKE_image.h
M	source/blender/blenkernel/BKE_mesh_sample.hh
M	source/blender/blenkernel/BKE_node.h
M	source/blender/blenkernel/BKE_scene.h
M	source/blender/blenkernel/BKE_spline.hh
M	source/blender/blenkernel/BKE_vfont.h
M	source/blender/blenkernel/BKE_volume.h
M	source/blender/blenkernel/intern/DerivedMesh.cc
M	source/blender/blenkernel/intern/attribute_access.cc
M	source/blender/blenkernel/intern/data_transfer_intern.h
M	source/blender/blenkernel/intern/geometry_component_mesh.cc
M	source/blender/blenkernel/intern/gpencil_geom.cc
M	source/blender/blenkernel/intern/hair.cc
M	source/blender/blenkernel/intern/image.c
M	source/blender/blenkernel/intern/mesh.cc
M	source/blender/blenkernel/intern/mesh_boolean_convert.cc
M	source/blender/blenkernel/intern/mesh_remesh_voxel.cc
M	source/blender/blenkernel/intern/object_dupli.cc
M	source/blender/blenkernel/intern/pointcloud.cc
M	source/blender/blenkernel/intern/simulation.cc
M	source/blender/blenkernel/intern/spline_base.cc
M	source/blender/blenkernel/intern/spline_bezier.cc
M	source/blender/blenkernel/intern/tracking_test.cc
M	source/blender/blenkernel/intern/type_conversions.cc
M	source/blender/blenkernel/intern/volume.cc
M	source/blender/blenkernel/intern/volume_render.cc
M	source/blender/blenkernel/intern/volume_to_mesh.cc
M	source/blender/blenlib/BLI_array_store.h
M	source/blender/blenlib/BLI_array_utils.h
M	source/blender/blenlib/BLI_buffer.h
M	source/blender/blenlib/BLI_delaunay_2d.h
D	source/blender/blenlib/BLI_double2.hh
D	source/blender/blenlib/BLI_double3.hh
M	source/blender/blenlib/BLI_fileops.h
D	source/blender/blenlib/BLI_float2.hh
D	source/blender/blenlib/BLI_float3.hh
D	source/blender/blenlib/BLI_float4.hh
M	source/blender/blenlib/BLI_float4x4.hh
M	source/blender/blenlib/BLI_gsqueue.h
M	source/blender/blenlib/BLI_listbase.h
M	source/blender/blenlib/BLI_math_boolean.hh
A	source/blender/blenlib/BLI_math_vec_mpq_types.hh
A	source/blender/blenlib/BLI_math_vec_types.hh
A	source/blender/blenlib/BLI_math_vector.hh
M	source/blender/blenlib/BLI_memarena.h
M	source/blender/blenlib/BLI_memory_utils.h
M	source/blender/blenlib/BLI_memory_utils.hh
M	source/blender/blenlib/BLI_mesh_intersect.hh
D	source/blender/blenlib/BLI_mpq2.hh
D	source/blender/blenlib/BLI_mpq3.hh
M	source/blender/blenlib/BLI_noise.hh
M	source/blender/blenlib/BLI_path_util.h
M	source/blender/blenlib/BLI_rand.hh
M	source/blender/blenlib/BLI_stack.h
M	source/blender/blenlib/BLI_string.h
M	source/blender/blenlib/BLI_string_utf8.h
M	source/blender/blenlib/BLI_string_utils.h
M	source/blender/blenlib/BLI_timecode.h
M	source/blender/blenlib/BLI_utildefines.h
M	source/blender/blenlib/CMakeLists.txt
M	source/blender/blenlib/intern/BLI_mempool_private.h
M	source/blender/blenlib/intern/delaunay_2d.cc
M	source/blender/blenlib/intern/math_boolean.cc
M	source/blender/blenlib/intern/math_vec.cc
M	source/blender/blenlib/intern/mesh_boolean.cc
M	source/blender/blenlib/intern/mesh_intersect.cc
M	source/blender/blenlib/intern/noise.cc
M	source/blender/blenlib/tests/BLI_delaunay_2d_test.cc
A	source/blender/blenlib/tests/BLI_math_vec_types_test.cc
M	source/blender/blenlib/tests/BLI_memory_utils_test.cc
M	source/blender/blenlib/tests/BLI_mesh_boolean_test.cc
M	source/blender/blenlib/tests/BLI_mesh_intersect_test.cc
M	source/blender/bmesh/intern/bmesh_opdefines.c
M	source/blender/bmesh/intern/bmesh_polygon.c
M	source/blender/compositor/CMakeLists.txt
M	source/blender/compositor/COM_defines.h
D	source/blender/compositor/COM_precomp.h
M	source/blender/compositor/operations/COM_OutputFileOperation.h
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/node/deg_node_factory.h
M	source/blender/draw/intern/draw_cache_impl_curve.cc
M	source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/include/ED_util.h
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface_intern.h
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/interface/interface_region_tooltip.c
M	source/blender/editors/interface/interface_style.c
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/render/render_preview.cc
M	source/blender/editors/space_file/file_draw.c
M	source/blender/editors/space_node/node_draw.cc
M	source/blender/editors/space_node/node_group.cc
M	source/blender/editors/space_node/node_intern.hh
M	source/blender/editors/space_node/node_select.cc
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/editors/space_spreadsheet/spreadsheet_column.cc
M	source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
M	source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
M	source/blender/editors/util/ed_draw.c
M	source/blender/freestyle/CMakeLists.txt
A	source/blender/freestyle/FRS_precomp.cpp
M	source/blender/functions/intern/cpp_types.cc
M	source/blender/imbuf/IMB_imbuf.h
M	source/blender/imbuf/IMB_metadata.h
M	source/blender/imbuf/intern/IMB_filetype.h
M	source/blender/imbuf/intern/anim_movie.c
M	source/blender/imbuf/intern/dds/dds_api.h
M	source/blender/imbuf/intern/oiio/openimageio_api.h
M	source/blender/imbuf/intern/openexr/openexr_api.h
M	source/blender/imbuf/intern/radiance_hdr.c
M	source/blender/io/alembic/intern/abc_reader_object.cc
M	source/blender/io/gpencil/intern/gpencil_io_base.cc
M	source/blender/io/gpencil/intern/gpencil_io_base.hh
M	source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
M	source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh
M	source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc
M	source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
M	source/blender/io/wavefront_obj/exporter/obj_export_nurbs.cc
M	source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_node_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_internal.h
M	source/blender/makesrna/intern/rna_internal_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/modifiers/intern/MOD_mesh_to_volume.cc
M	source/blender/modifiers/intern/MOD_nodes.cc
M	source/blender/nodes/NOD_math_functions.hh
M	source/blender/nodes/NOD_socket_declarations.hh
M	source/blender/nodes/composite/node_composite_tree.cc
M	source/blender/nodes/composite/nodes/node_composite_image.cc
M	source/blender/nodes/function/node_function_util.hh
M	source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc
M	source/blender/nodes/function/nodes/node_fn_compare.cc
M	source/blender/nodes/geometry/node_geometry_util.hh
M	source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_align_rotation_to_vector.cc
M	source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_proximity.cc
M	source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_attribute_transfer.cc
M	source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_curve_to_points.cc
M	source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_point_distribute.cc
M	source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_points_to_volume.cc
M	source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_raycast.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_primitive_line.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadratic_bezier.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
M	source/blender/nodes/geometry/nodes/node_geo_image_texture.cc
M	source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc
M	source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc
M	source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc
M	source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
M	source/blender/nodes/geometry/nodes/node_geo_proximity.cc
M	source/blender/nodes/geometry/nodes/node_geo_raycast.cc
M	source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc
M	source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc
M	source/blender/nodes/geometry/nodes/node_geo_transform.cc
M	source/blender/nodes/intern/node_socket.cc
M	source/blender/nodes/shader/node_shader_util.hh
M	source/blender/nodes/shader/nodes/node_shader_map_range.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_brick.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_noise.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc
M	source/blender/python/generic/py_capi_utils.h
M	source/blender/render/RE_bake.h
M	source/blender/sequencer/intern/effects.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_files.c

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 88c71899f8e..5c5b5eb317e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -559,14 +559,12 @@ if(WIN32)
   set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
 endif()
 
-# Compiler tool-chain.
-if(UNIX AND NOT APPLE)
-  if(CMAKE_COMPILER_IS_GNUCC)
-    option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
-    mark_as_advanced(WITH_LINKER_GOLD)
-    option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
-    mark_as_advanced(WITH_LINKER_LLD)
-  endif()
+# Compiler toolchain
+if(CMAKE_COMPILER_IS_GNUCC)
+  option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
+  mark_as_advanced(WITH_LINKER_GOLD)
+  option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
+  mark_as_advanced(WITH_LINKER_LLD)
 endif()
 
 option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
diff --git a/build_files/build_environment/cmake/gmp.cmake b/build_files/build_environment/cmake/gmp.cmake
index dbcce12d24b..6ca81678a32 100644
--- a/build_files/build_environment/cmake/gmp.cmake
+++ b/build_files/build_environment/cmake/gmp.cmake
@@ -38,6 +38,13 @@ elseif(UNIX AND NOT APPLE)
   )
 endif()
 
+if(BLENDER_PLATFORM_ARM)
+  set(GMP_OPTIONS
+    ${GMP_OPTIONS}
+    --disable-assembly
+  )
+endif()
+
 ExternalProject_Add(external_gmp
   URL file://${PACKAGE_DIR}/${GMP_FILE}
   DOWNLOAD_DIR ${DOWNLOAD_DIR}
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index c758dbd265e..f2c245dc380 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -474,9 +474,9 @@ set(ISPC_HASH 2e3abedbc0ea9aaec17d6562c632454d)
 set(ISPC_HASH_TYPE MD5)
 set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
 
-set(GMP_VERSION 6.2.1)
+set(GMP_VERSION 6.2.0)
 set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
-set(GMP_HASH 0b82665c4a92fd2ade7440c13fcaa42b)
+set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
 set(GMP_HASH_TYPE MD5)
 set(GMP_FILE gmp-${GMP_VERSION}.tar.xz)
 
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 25a8b66af51..34c2c9a684d 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -1292,6 +1292,29 @@ macro(openmp_delayload
     endif()
 endmacro()
 
+macro(blender_precompile_headers target cpp header)
+  if(MSVC)
+    # get the name for the pch output file
+    get_filename_component(pchbase ${cpp} NAME_WE)
+    set(pchfinal "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${pchbase}.pch")
+
+    # mark the cpp as the one outputting the pch
+    set_property(SOURCE ${cpp} APPEND PROPERTY OBJECT_OUTPUTS "${pchfinal}")
+
+    # get all sources for the target
+    get_target_property(sources ${target} SOURCES)
+
+    # make all sources depend on the pch to enforce the build order
+    foreach(src ${sources})
+      set_property(SOURCE ${src} APPEND PROPERTY OBJECT_DEPENDS "${pchfinal}")
+    endforeach()
+
+    target_sources(${target} PRIVATE ${cpp} ${header})
+    set_target_properties(${target} PROPERTIES COMPILE_FLAGS "/Yu${header} /Fp${pchfinal} /FI${header}")
+    set_source_files_properties(${cpp} PROPERTIES COMPILE_FLAGS "/Yc${header} /Fp${pchfinal}")
+  endif()
+endmacro()
+
 macro(set_and_warn_dependency
   _dependency _setting _val)
   # when $_dependency is disabled, forces $_setting = $_val
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index 0aaec3083a3..2f1a622c63d 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -18,7 +18,7 @@
 # All rights reserved.
 # ***** END GPL LICENSE BLOCK *****
 
-# Libraries configuration for any *nix system including Linux and Unix (excluding APPLE).
+# Libraries configuration for any *nix system including Linux and Unix.
 
 # Detect precompiled library directory
 if(NOT DEFINED LIBDIR)
diff --git a/extern/hipew/src/hipew.c b/extern/hipew/src/hipew.c
index ecf952e266f..010c361fa46 100644
--- a/extern/hipew/src/hipew.c
+++ b/extern/hipew/src/hipew.c
@@ -257,7 +257,7 @@ static int hipewHipInit(void) {
 #endif
   static int initialized = 0;
   static int result = 0;
-  int error;
+  int error, driver_version;
 
   if (initialized) {
     return result;
@@ -565,6 +565,8 @@ int hipewCompilerVersion(void) {
   const char *path = hipewCompilerPath();
   const char *marker = "Hip compilation tools, release ";
   FILE *pipe;
+  int major, minor;
+  char *versionstr;
   char buf[128];
   char output[65536] = "\0";
   char command[65536] = "\0";
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 7fe9300ec3f..ce0185bc7d0 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -496,6 +496,8 @@ typedef struct {
   int target_start;
   /** Represents the position of the end of the selection */
   int target_end;
+  /** custom temporal data */
+  GHOST_TUserDataPtr tmp;
 } GHOST_TEventImeData;
 
 typedef struct {
diff --git a/release/scripts/addons b/release/scripts/addons
index c08568cc376..67f1fbca148 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit c08568cc376d2e4298710c4172fb0c74f0611de1
+Subproject commit 67f1fbca1482d9d9362a4001332e785c3fd5d230
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py
index f0e099244f4..45d1ea98a8a 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -949,7 +949,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
             """Make all the newly created and the old objects of a collection """ \
                 """to be properly setup for shadow catch"""
             for ob in collection.objects:
-                ob.is_shadow_catcher = True
+                ob.cycles.is_shadow_catcher = True
                 for child in collection.children:
                     setup_shadow_catcher_objects(child)
 
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 169107b19cb..76a6135baaf 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -122,7 +122,7 @@ void BLF_draw(int fontid, const char *str, size_t str_len) ATTR_NONNULL(2);
 int BLF_draw_mono(int fontid, const char *str, size_t str_len, int cwidth) ATTR_NONNULL(2);
 
 typedef bool (*BLF_GlyphBoundsFn)(const char *str,
-                                  size_t str_step_ofs,
+                                  const size_t str_step_ofs,
                                   const struct rcti *glyph_step_bounds,
                                   int glyph_advance_x,
                                   const struct rctf *glyph_bounds,
diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h
index 4e36f522981..23e42ec777f 100644
--- a/source/blender/blenfont/intern/blf_internal.h
+++ b/source/blender/blenfont/intern/blf_internal.h
@@ -121,7 +121,7 @@ void blf_font_boundbox_foreach_glyph(struct FontBLF *font,
                                      const char *str,
                                      size_t str_len,
                                      bool (*user_fn)(const char *str,
-                                                     size_t str_step_ofs,
+                                                     const size_t str_step_ofs,
                                                      const struct rcti *glyph_step_bounds,
                                                      int glyph_advance_x,
                                                      const struct rctf *glyph_bounds,
@@ -132,7 +132,7 @@ void blf_font_boundbox_foreach_glyph(struct FontBLF *font,
 
 int blf_font_count_missing_chars(struct FontBLF *font,
                                  const char *str,
-                                 size_t str_len,
+                                 const size_t str_len,
                                  int *r_tot_chars);
 
 void blf_font_free(struct FontBLF *font);
diff --git a/source/blender/blenkernel/BKE_appdir.h b/source/blender/blenkernel/BKE_appdir.h
index a7baaed141f..e92909fb3ca 100644
--- a/source/blender/blenkernel/BKE_appdir.h
+++ b/source/blender/blenkernel/BKE_appdir.h
@@ -140,7 +140,7 @@ bool BKE_appdir_font_folder_default(char *dir);
  * Find Python executable.
  */
 bool BKE_appdir_program_python_search(char *fullpath,
-                                      size_t fullpath_len,
+                                      const size_t fullpath_len,
                                       int version_major,
                                       int version_minor);
 
diff --git a/source/blender/blenkernel/BKE_attribute.h b/source/blender/blenkernel/BKE_attribute.h
index 6020da08f51..db8f3759bf8 100644
--- a/source/blender/blenkernel/BKE_attribute.h
+++ b/source/blender/blenkernel/BKE_attribute.h
@@ -73,7 +73,7 @@ bool BKE_id_attribute_rename(struct ID *id,
                              const char *new_name,
                              struct ReportList *reports);
 
-int BKE_id_attributes_length(struct ID *id, CustomDataMask mask);
+int BKE_id_attributes_length(struct ID *id, const CustomDataMask mask);
 
 struct CustomDataLayer *BKE_id_attributes_active_get(struct ID *id);
 void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer);
diff --git a/source/blender/blenkernel/BKE_attribute_access.hh b/source/blender/blenkernel/BKE_attribute_access.hh
index f69ba79e23f..3ffdcee05eb 100644
--- a/source/blender/blenkernel/BKE_attribute_access.hh
+++ b/source/blender/blenkernel/BKE_attribute_access.hh
@@ -26,9 +26,8 @@
 #include "BKE_attribute.h"
 
 #include "BLI_color.hh"
-#include "BLI_float2.hh"
-#include "BLI_float3.hh"
 #include "BLI_function_ref.hh"
+#include "BLI_math_vec_types.hh"
 
 /**
  * This file defines classes that help to provide access to attribute data on a #GeometryComponent.
diff --git a/source/blender/blenkernel/BKE_attribute_math.hh b/source/blender/blenkernel

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list