Sculpt: Reduce size of undo node struct
All checks were successful
buildbot/vdev-code-daily-lint Build done.
buildbot/vdev-code-daily-linux-x86_64 Build done.
buildbot/vdev-code-daily-darwin-arm64 Build done.
buildbot/vdev-code-daily-darwin-x86_64 Build done.
buildbot/vdev-code-daily-windows-amd64 Build done.
buildbot/vdev-code-daily-coordinator Build done.
All checks were successful
buildbot/vdev-code-daily-lint Build done.
buildbot/vdev-code-daily-linux-x86_64 Build done.
buildbot/vdev-code-daily-darwin-arm64 Build done.
buildbot/vdev-code-daily-darwin-x86_64 Build done.
buildbot/vdev-code-daily-windows-amd64 Build done.
buildbot/vdev-code-daily-coordinator Build done.
This struct should be split in the future, but for now its size matters since one is created for every BVH node for every undo step. Removing the inline buffers for the arrays is a simple way to reduce the size from 672 to 400 bytes.
This commit is contained in:
parent
e950bea4df
commit
d31c633f4c
@ -1161,7 +1161,7 @@ static void alloc_and_store_hidden(const SculptSession &ss,
|
||||
}
|
||||
|
||||
const Span<int> grid_indices = bke::pbvh::node_grid_indices(node);
|
||||
unode.grid_hidden = BitGroupVector<>(grid_indices.size(), grid_hidden.group_size());
|
||||
unode.grid_hidden = BitGroupVector<0>(grid_indices.size(), grid_hidden.group_size());
|
||||
for (const int i : grid_indices.index_range()) {
|
||||
unode.grid_hidden[i].copy_from(grid_hidden[grid_indices[i]]);
|
||||
}
|
||||
|
@ -46,32 +46,32 @@ enum class Type : int8_t {
|
||||
};
|
||||
|
||||
struct Node {
|
||||
Array<float3> position;
|
||||
Array<float3> orig_position;
|
||||
Array<float3> normal;
|
||||
Array<float4> col;
|
||||
Array<float> mask;
|
||||
Array<float3, 0> position;
|
||||
Array<float3, 0> orig_position;
|
||||
Array<float3, 0> normal;
|
||||
Array<float4, 0> col;
|
||||
Array<float, 0> mask;
|
||||
|
||||
Array<float4> loop_col;
|
||||
Array<float4, 0> loop_col;
|
||||
|
||||
/* Mesh. */
|
||||
|
||||
Array<int> vert_indices;
|
||||
Array<int, 0> vert_indices;
|
||||
int unique_verts_num;
|
||||
|
||||
Array<int> corner_indices;
|
||||
Array<int, 0> corner_indices;
|
||||
|
||||
BitVector<> vert_hidden;
|
||||
BitVector<> face_hidden;
|
||||
BitVector<0> vert_hidden;
|
||||
BitVector<0> face_hidden;
|
||||
|
||||
/* Multires. */
|
||||
|
||||
/** Indices of grids in the pbvh::Tree node. */
|
||||
Array<int> grids;
|
||||
BitGroupVector<> grid_hidden;
|
||||
Array<int, 0> grids;
|
||||
BitGroupVector<0> grid_hidden;
|
||||
|
||||
/* Sculpt Face Sets */
|
||||
Array<int> face_sets;
|
||||
Array<int, 0> face_sets;
|
||||
|
||||
Vector<int> face_indices;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user