diff --git a/source/blender/blenkernel/intern/grease_pencil.cc b/source/blender/blenkernel/intern/grease_pencil.cc index 4139bca25d8..88d65daa988 100644 --- a/source/blender/blenkernel/intern/grease_pencil.cc +++ b/source/blender/blenkernel/intern/grease_pencil.cc @@ -640,7 +640,7 @@ static float3x2 get_stroke_to_texture_matrix(const float uv_rotation, return texture_matrix; } -static float4x3 expand_4x2_mat(float4x2 strokemat) +static float4x3 expand_4x2_mat(const float4x2 &strokemat) { float4x3 strokemat4x3 = float4x3(strokemat); diff --git a/source/blender/draw/intern/draw_view.hh b/source/blender/draw/intern/draw_view.hh index e9ab7379651..e5239abc6bd 100644 --- a/source/blender/draw/intern/draw_view.hh +++ b/source/blender/draw/intern/draw_view.hh @@ -194,7 +194,7 @@ class View { { } - float4x4 winmat_polygon_offset(float4x4 winmat, float offset) + float4x4 winmat_polygon_offset(const float4x4 &winmat, float offset) { float view_dist = dist; /* Special exception for orthographic camera: @@ -203,12 +203,13 @@ class View { view_dist = 1.0f / max_ff(fabsf(winmat[0][0]), fabsf(winmat[1][1])); } - winmat[3][2] -= GPU_polygon_offset_calc(winmat.ptr(), view_dist, offset); - return winmat; + float4x4 result = winmat; + result[3][2] -= GPU_polygon_offset_calc(winmat.ptr(), view_dist, offset); + return result; } /* Return unit offset to apply to `gl_Position.z`. To be scaled depending on purpose. */ - float polygon_offset_factor(float4x4 winmat) + float polygon_offset_factor(const float4x4 &winmat) { float view_dist = dist; /* Special exception for orthographic camera: diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc index 5fc95219d9f..5f85f698eba 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc @@ -1548,8 +1548,8 @@ float radius_from_input_sample(const RegionView3D *rv3d, const ARegion *region, const Brush *brush, const float pressure, - const float3 location, - const float4x4 to_world, + const float3 &location, + const float4x4 &to_world, const BrushGpencilSettings *settings) { float radius = brush_radius_at_location(rv3d, region, brush, location, to_world); diff --git a/source/blender/editors/include/ED_grease_pencil.hh b/source/blender/editors/include/ED_grease_pencil.hh index ebe636f7abc..3061eac3122 100644 --- a/source/blender/editors/include/ED_grease_pencil.hh +++ b/source/blender/editors/include/ED_grease_pencil.hh @@ -342,8 +342,8 @@ float radius_from_input_sample(const RegionView3D *rv3d, const ARegion *region, const Brush *brush, float pressure, - float3 location, - float4x4 to_world, + const float3 &location, + const float4x4 &to_world, const BrushGpencilSettings *settings); wmOperatorStatus grease_pencil_draw_operator_invoke(bContext *C, wmOperator *op, diff --git a/source/blender/geometry/intern/mesh_boolean_manifold.cc b/source/blender/geometry/intern/mesh_boolean_manifold.cc index 1ada5d32473..f0a485e5045 100644 --- a/source/blender/geometry/intern/mesh_boolean_manifold.cc +++ b/source/blender/geometry/intern/mesh_boolean_manifold.cc @@ -1662,7 +1662,7 @@ static void get_intersecting_edges(Vector *r_intersecting_edges, * from the origin to the plane in the normal direction. */ static bool is_plane(const Mesh *mesh, - float4x4 transform, + const float4x4 &transform, float3 *r_normal, float *r_origin_offset) {