Conversation
30be894 to
26e0d26
Compare
AzurIce
added a commit
that referenced
this pull request
Feb 24, 2026
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.
Closes #139
Summary
Merge all VItem data into a single set of contiguous GPU buffers and use instanced drawing to render all VItems in one draw call, eliminating per-VItem CPU submission overhead.
Approach
ItemInfoindex tableitem_infosto find each point's owning item, performs 3D→2D projection + atomic clip box updatesdraw(0..4, 0..N)instanced drawing; vertex shader looks up per-item data viainstance_indexNew files
primitives/merged_vitem.rs—MergedVItemBuffer: CPU-side data packing, bind group managementpipelines/merged_vitem.rs— compute / depth / color pipeline definitionsshaders/merged_vitem_compute.wgsl— merged compute shader (binary search + atomic clip box)shaders/merged_vitem.wgsl— merged render shader (instanced vertex + SDF fragment)Renderer::render_store_merged()— merged rendering entry point that bypasses the render graphBenchmark comparison
The original rendering path is kept intact for A/B comparison.
CPU submission time (the bottleneck)
Total time (CPU + GPU)
CPU submission time is now essentially constant (~1.9ms) regardless of VItem count. At 3600 VItems, total frame time drops from 256ms to 5ms.
Visual correctness
Both paths produce identical output for the same scene (including OIT transparency and depth ordering).