Repository navigation
Renderer: draws assembled in place (appendVertices, drawRange, continueFrame) - #140
Merged
Merged
Conversation
…ueFrame) A port that makes its draws' vertices itself (Shinobido's GS translator: 30,000 primitives a frame) built them in its own batches and draw() copied every one into the frame being built at the flip. Now it can make them straight into that frame: appendVertices gives room at its end, drawRange adds a batch over vertices already there (two batches may share a range, as a two-pass draw's do), and continueFrame starts the frame like beginFrame but keeps the vertices appended since the last one ended. draw() is append + drawRange (a refused batch keeps none of its vertices). tests/render/draw_in_place_tests.cpp: the same frame digest as draw()'s copies, shared ranges, a range past the vertices refused, beginFrame dropping what was appended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A port that makes its draws' vertices itself (Shinobido's GS translator: about 30,000 primitives a frame) built them in its own batches, and
draw()copied every one into the frame being built at the flip (3-6 MB a frame at Shinobido's castle load).Now it can make them straight into that frame:
appendVertices(count)gives room at the frame's end (the pointer good until the next append);builtVertices()how many it holds.drawRange(material, matrix, first, count, texture)adds a batch over vertices already there; two batches may share a range (a two-pass draw).continueFrame(screen)starts the frame likebeginFramebut keeps the vertices appended since the last frame ended.draw()is now append +drawRange(a refused batch keeps none of its vertices), so existing ports are unchanged.Test:
tests/render/draw_in_place_tests.cpp(the same frame digest asdraw()'s copies, shared ranges, a range past the vertices refused,beginFramedropping what was appended);native_colour_levelsstill passes.In Shinobido: the vertex checksums and a gameplay capture are the same; the copy's 2-4.5% of the game thread goes.
🤖 Generated with Claude Code