Repository navigation
Replace streams with loops in the chunk upload path - #575
Open
BonsUnleashed wants to merge 1 commit into
Open
BonsUnleashed wants to merge 1 commit into
BonsUnleashed wants to merge 1 commit into
Conversation
…kkeeping Before drawing newly built chunks, the renderer organizes data and creates temporary lists, even when some lists will be empty. These changes reduce that preparation and create fewer temporary objects. The same drawing data still reaches the graphics card; an overall frame-rate gain has not been established. Source port of a change shipped in Bons and Furious 1.0.15.
|
DCO Assistant Lite bot All contributors have read and affirmed the entire contents of the Developer Certificate of Origin. |
Author
|
I have read and hereby affirm the entire contents of the Developer Certificate of Origin. |
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.
Proposed Changes
Removes stream and list allocations from the chunk mesh upload path:
RenderRegionManager: the mesh / index-only split and the vertex and index upload lists are built with plain loops instead of streams. An empty group uses the shared empty list.PendingResortUpload.indexUploadis always set, so the resort path no longer filters nulls.RenderSectionManager.collectChunkBuildResults: returns an empty list when no build has finished, instead of allocating one every frame.GlBufferArena.upload: takes aCollection<PendingUpload>instead of aStream(RenderRegionManageris its only caller) and sums the remaining bytes in a loop.Upload order and uploaded data are unchanged. With the same change applied to 0.3.31, classifying eight outputs went from about 151 ns and 504 bytes to 62 ns and 160 bytes, and frames with no finished builds no longer allocate here. It's not a measurable FPS change on its own.
Compiles on
20.1/forge(compileJava). Not tested in game on this branch.Bons and Furious currently ships a patch for this: CurseForge · Modrinth (page still in review) · GitHub release