Fix count-then-fill vector rendering#10
Merged
Merged
Conversation
…onvergence - shapes.py: force per-instance direction stride for vector renderers. The count-then-fill output buffer is momentarily 1 element (the bootstrap), which the stride heuristic read as "one constant direction for all" (stride 0) → every arrow read directions[0] → all arrows pointed the same way. Renderers that set _directions_per_instance now always stride 12. - engine/compute.js: on a count-then-fill resize the output buffer is freshly allocated and EMPTY (the fill runs next frame via onRerender). Writing the readback count to the indirect buffer then drew uninitialized slots → garbage positions/directions (random vectors / jumps during clip drag). Draw 0 until the refill; the next execute's cap shader sets the real count. processReadbacks() now returns whether it resized. - engine/engine.js: add settle() to drive count-then-fill passes to convergence for one-shot captures (screenshots/headless), so they don't render blank; captureFrameBuffer() settles first; _renderNow() gains an autoReadback flag so settle() can drive the readbacks itself. - scene.py: set _render_via_js so vector renderers skip their blocking Python count+eval+readback bootstrap when a live JS engine (GUI) or the exported HTML engine owns rendering and runs the count-then-fill GPU-side. Co-Authored-By: Claude Opus 4.8 <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.
No description provided.