meshletutils: Extract meshlet utilities from clusterizer.cpp#1020
Merged
meshletutils: Extract meshlet utilities from clusterizer.cpp#1020
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change "simply" splits
clusterizer.cppinto two files,clusterizer.cpp(forbuildMeshlets*) andmeshletutils.cpp(forcompute*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 ofclodLocalIndicesit 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 ensuremeshletutils.cpphasclusterizer.cppas its ancestor in the history. Also the file changes had to be done in a series of commits to avoid confusinggit difftoo much.This contribution is sponsored by Valve.