Batcher buffers merging optimization #7109
Merged
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.
Batcher consists of multiple parts:
This PR focuses on the third case by decomposing some math functions that are called frequently, which results in significant performance gains in some of our tests.
In a scene with 749 batches, on test machine currently it takes:
~1658ms to apply position transformations and 612ms on normals transformations.
With this PR these numbers become:
~216ms to apply position transformations and 155ms on normals transformations.
In this specific case we have x7.7 time speed up on positions and x3.9 times speed up on normals.
We've tested multiple cases, and gains can vary from x1.5 to x10, depending on number of meshes per batch and how large these meshes are.
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.