-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow for custom batchers #10885
Merged
Merged
Conversation
This file contains 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
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9210fd9:
|
Zyie
reviewed
Sep 5, 2024
* batch renaming and prop clean up extracted default shader * DefaultBatchableElement -> DefaultBatchableMeshElement * doc * fix lint * Update src/rendering/batcher/shared/DefaultBatcher.ts Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com> * add docs --------- Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com>
Zyie
reviewed
Sep 10, 2024
Zyie
approved these changes
Sep 11, 2024
Zyie
added
the
✅ Ready To Merge
Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
label
Sep 11, 2024
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
✅ Ready To Merge
Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
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.
Description of change
Did a pass at making the batcher generic. This is to set it up so that creating custom batchers becomes much easier. This will ultimatly take a few steps. This is the first one!
Essentially it removes the packAttributes / packIndex from the batchable objects and moves it to a batcher instead. This means we can create new batchers and modify the packAttribute function without having to modify any of the other batchable classes!
I also added a
packQuadAttributes
function to the batchers as this lets us batch the sprites even faster. Without this perf would be slower for spritesas we would need to copy sprite to a format packAttribute undertands and then copy that to the batch.packQuadAttributes
does this in one step.This is a draft for people to see where im at. Next steps will be:
Oh and as a bonus - bunny mark is running a bit faster now too.. so we will get some more perf wins! woop!
Pre-Merge Checklist
npm run lint
)npm run test
)