Skip to content

Remove old per-item rendering pipeline and consolidate into GPU-driven path#141

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-gpu-at-per-item-alloc
Closed

Remove old per-item rendering pipeline and consolidate into GPU-driven path#141
Copilot wants to merge 2 commits intomainfrom
copilot/fix-gpu-at-per-item-alloc

Conversation

Copy link

Copilot AI commented Feb 24, 2026

The GPU-driven renderer was still performing a per-item alloc_packet call for every VItem on each frame, and the old CPU-driven per-item rendering pipeline was never removed when the merged (GPU-driven) rendering path was introduced.

Changes

  • Removed the per-VItem pool.alloc_packet loop in render_store_with_pool (packages/ranim-render/src/lib.rs)
  • Removed the entire old per-item rendering pipeline:
    • Graph nodes: old VItemComputeNode, VItemDepthNode, VItemColorNode (per-item path)
    • Pipelines: old VItemColorPipeline, VItemDepthPipeline, VItemComputePipeline (per-item path) and associated bind groups
    • Shaders: old vitem.wgsl, vitem_compute.wgsl (per-item path)
    • VItemRenderInstance, PlaneUniform, and impl Primitive for VItem from primitives/vitem.rs
  • Renamed the GPU-driven (Merged*) nodes and pipelines to drop the Merged prefix:
    • MergedVItemComputeNodeVItemComputeNode
    • MergedVItemDepthNodeVItemDepthNode
    • MergedVItemColorNodeVItemColorNode
    • MergedVItemComputePipelineVItemComputePipeline
    • MergedVItemColorPipelineVItemColorPipeline
    • MergedVItemDepthPipelineVItemDepthPipeline
    • merged_vitem.wgslvitem.wgsl, merged_vitem_compute.wgslvitem_compute.wgsl
  • Renamed build_merged_render_graph()build_render_graph() and removed the deprecated old build_render_graph() in lib.rs

The GPU-driven path (now the only path) reads exclusively from MergedVItemBuffer, issuing a single batched draw call for all items rather than allocating and dispatching per-item GPU resources.

Original prompt

This section details on the original issue you should resolve

<issue_title>GPU-driven rendering still do per-item alloc</issue_title>
<issue_description>related: #139 #138

My fault, forgot to remove.

// Per-VItem packets (old path nodes query these; merged nodes ignore them)
self.packets.extend(
store
.vitems
.iter()
.map(|(_id, data)| pool.alloc_packet(ctx, data)),
);
</issue_description>

<agent_instructions>Fix it</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@AzurIce
Copy link
Owner

AzurIce commented Feb 24, 2026

Can completely remove the old per-item pipeline, and only keep the Merged ones (the GPU-driven one), and rename them to name without Merged. @copilot

Co-authored-by: AzurIce <22115534+AzurIce@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GPU-driven rendering per-item allocation issue Remove leftover per-item GPU buffer allocation in merged rendering path Feb 24, 2026
Copilot AI requested a review from AzurIce February 24, 2026 09:43
@AzurIce AzurIce closed this Feb 24, 2026
Copy link
Author

Copilot AI commented Feb 24, 2026

Can completely remove the old per-item pipeline, and only keep the Merged ones (the GPU-driven one), and rename them to name without Merged. @copilot

Done in c247f0a. Removed all old per-item pipeline nodes (VItemComputeNode, VItemDepthNode, VItemColorNode — old per-item versions) and their associated pipeline structs, bind groups, and shaders. The GPU-driven merged nodes are now renamed to VItemComputeNode, VItemDepthNode, VItemColorNode (and pipelines similarly). Also cleaned up VItemRenderInstance/PlaneUniform from primitives/vitem.rs and graph/mod.rs since they were only used by the old path.

Copilot AI changed the title Remove leftover per-item GPU buffer allocation in merged rendering path Remove old per-item rendering pipeline and consolidate into GPU-driven path Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPU-driven rendering still do per-item alloc

2 participants