Skip to content

meshletutils: Extract meshlet utilities from clusterizer.cpp#1020

Merged
zeux merged 8 commits intomasterfrom
meshletutils
Feb 20, 2026
Merged

meshletutils: Extract meshlet utilities from clusterizer.cpp#1020
zeux merged 8 commits intomasterfrom
meshletutils

Conversation

@zeux
Copy link
Owner

@zeux zeux commented Feb 19, 2026

This change "simply" splits clusterizer.cpp into two files, clusterizer.cpp (for buildMeshlets*) and meshletutils.cpp (for compute*Bounds/optimizeMeshlet). We used to have all meshlet-specific functionality in a single source file, but with meshletcodec and potential future additions like a port of clodLocalIndices it makes more sense to split, and clusterization code is very self contained so the split is simple...

... except that nothing is simple when you want to preserve git blame, so this change uses a two-branch merge-with-conflict strategy to ensure meshletutils.cpp has clusterizer.cpp as its ancestor in the history. Also the file changes had to be done in a series of commits to avoid confusing git diff too much.

This contribution is sponsored by Valve.

zeux added 8 commits February 19, 2026 09:56
This is an auxiliary commit needed to trick git into preserving blame
post-file split.
This change still keeps some of the clusterizer helper functions,
because doing a complete cleanup in one commit confuses git diff.
The file is now self-contained and only contains meshlet utilities:
bounding sphere and bounds computation as well as meshlet optimizer.
All of the bounds utility functions as well as meshlet optimizer are
going to be moved to meshletutils.cpp; the commits can't be atomic
because of complications with preserving git blame history.
This merge splits clusterizer.cpp into two files: clusterizer.cpp for
the clusterization code (buildMeshlets*) and meshletutils.cpp for
everything else (compute*Bounds, optimizeMeshlet).

The merge merges two branches: one introduces meshletutils.cpp as a file
*move*, and removes the functionality that should stay in
clusterizer.cpp; the other one just removes extra functionality from
clusterizer.cpp.

This two-branch-merge should trick git into preserving blame history for
the new file.
kMeshletMax* constants are only used for sanity checking here; we also
can't keep them as is because amalgamated build would result in symbol
conflicts with meshletutils.cpp.

Also remove references that were only relevant for cluster bounds
computation.
clusterfuzz build was actually broken a few months ago; clusterfuzz now
needs partition.cpp to function.
Also rename kAxes inside the function, as we use regular variable syntax
for function-scoped statics and this was the last place left using kName.
@zeux zeux merged commit c5ae921 into master Feb 20, 2026
13 checks passed
@zeux zeux deleted the meshletutils branch February 20, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant