Skip to content

vello_gpu: store strips data in arena - #1897

Merged
LaurenzV merged 3 commits into
linebender:mainfrom
HigherOrderLogic:gpu/strips
Sep 14, 2026
Merged

LaurenzV merged 3 commits into
linebender:mainfrom
HigherOrderLogic:gpu/strips

Conversation

@HigherOrderLogic

Copy link
Copy Markdown
Contributor

Clear the TODO.

@grebmeg grebmeg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if LGT @LaurenzV

Comment thread vello_gpu/src/render/wgpu/mod.rs Outdated
}

#[derive(Debug)]
struct StripsArena {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe StripBufferArena?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to look into applying the same frame-arena approach to the WebGL backend as a follow-up? WebGL currently reallocates the strip buffer for each pass, so it may benefit from the same reuse strategy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to look into applying the same frame-arena approach to the WebGL backend as a follow-up?

I'll do it at a later date. I should have one more arena optimization for the Wgpu backend first, then I'll consider if these can be applied to the WebGL one.

Comment on lines +2577 to 2579
let mut view = queue
.write_buffer_with(&arena.buffer, offset, size)
.expect("Capacity handled in creation");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes per-pass destination-buffer creation, but write_buffer_with still allocates temporary staging storage on native wgpu for every pass. Could we retain the staging-allocation TODO?

@LaurenzV

Copy link
Copy Markdown
Collaborator

Thanks! Looking at the profile I think removing the temporary CPU-side staging buffers from wgpu will give us the biggest wins, but this is a good improvement nevertheless!

image

@LaurenzV
LaurenzV enabled auto-merge September 14, 2026 10:45
@LaurenzV
LaurenzV added this pull request to the merge queue Sep 14, 2026
Merged via the queue into linebender:main with commit 3fb3e04 Sep 14, 2026
22 checks passed
@HigherOrderLogic
HigherOrderLogic deleted the gpu/strips branch September 14, 2026 11:20
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.

3 participants