Skip to content

Upgrade to wgpu v29. Reduce MSRV to 1.88.#1534

Merged
nicoburns merged 3 commits into
linebender:mainfrom
nicoburns:wgpu29
Apr 23, 2026
Merged

Upgrade to wgpu v29. Reduce MSRV to 1.88.#1534
nicoburns merged 3 commits into
linebender:mainfrom
nicoburns:wgpu29

Conversation

@nicoburns
Copy link
Copy Markdown
Contributor

@nicoburns nicoburns commented Mar 24, 2026

Upgrade Vello and Vello Hybrid to wgpu v29. Also reduces MSRV to 1.88 as wgpu lowered theirs.

https://github.com/gfx-rs/wgpu/releases/tag/v29.0.0

@nicoburns nicoburns changed the title Upgrade to wgpu v29 Upgrade to wgpu v29. Reduce MSRV to 1.88. Mar 24, 2026
Comment thread README.md
## Minimum supported Rust Version (MSRV)

This version of Vello has been verified to compile with **Rust 1.86** and later.
This version of Vello has been verified to compile with **Rust 1.88** and later.
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.

This should have been updated to 1.92 with the wgpu v28 bump but got missed

Comment on lines +191 to +196
CurrentSurfaceTexture::Occluded
| CurrentSurfaceTexture::Timeout
| CurrentSurfaceTexture::Outdated
| CurrentSurfaceTexture::Suboptimal(_) => {
return;
}
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.

Should we really silently return in case those happened? Seems to me like, especially for the example, it's fine to just panic here

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.

People will copy the example.

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.

But then is the best thing to do really to just return? I don't know, I'm not super familiar with wgpu API. 😄

Copy link
Copy Markdown
Contributor Author

@nicoburns nicoburns Mar 25, 2026

Choose a reason for hiding this comment

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

It's important not to panic here (which we were previously doing!). These errors can and do happen relatively often (we've gotten bug reports for Blitz), but they are transient/recoverable errors so the recommended thing to do is skip the current frame and immediately retry by rendering another frame.

See the WGPU v29 release notes, where they've intentionally changed this API not to use Result to push people towards not just calling unwrap/expect on these errors. https://github.com/gfx-rs/wgpu/releases/tag/v29.0.0

For some of those cases, I'm supposed to "reconfigure the surface", which I have done in the native cases, but I wasn't sure how to do that on the webgl backend. And for the Lost case you're apparently supposed to recreate the device in some cases (but I think this happens much less often so I'm happy to just continue panicking here for now).

.surface
.get_current_texture()
.expect("failed to get surface texture");
let surface_texture = match surface.surface.get_current_texture() {
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.

Same here.

Comment thread vello/src/util.rs
let backend_options = wgpu::BackendOptions::from_env_or_default();
let instance = Instance::new(&wgpu::InstanceDescriptor {
let instance = Instance::new(wgpu::InstanceDescriptor {
// TODO: consider allowing users to pass display handle when constructing a RenderContext
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.

Will this cause regressions for existing users if we don't allow this now?

Copy link
Copy Markdown
Contributor Author

@nicoburns nicoburns Mar 25, 2026

Choose a reason for hiding this comment

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

My understanding is that this primarily impacts GL backends. Which I think is not relevant at all for Vello Classic. It could potentially affect Vello Hybrid (but the WebGL backend has a separate setup where we do already pass the "web display handle").

So I believe it would be "people running Vello Hybrid with OpenGL on native platforms" that would need this.

PR for this is gfx-rs/wgpu#8782

.surface
.get_current_texture()
.expect("failed to get surface texture");
let surface_texture = match surface.surface.get_current_texture() {
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.

Same as before.

@nicoburns
Copy link
Copy Markdown
Contributor Author

Very confused what's going on with CI here: the errors seem to reference code which doesn't exist (either locally or in the Github view of the file). And the commands are passing locally :/ And I've also tried busting the cache (by changing the cache key), which seems to be working because it says "no cache found", but that doesn't seem to help.

@xStrom @DJMcNab Any idea what might be going on here? Am I being an idiot?

@DJMcNab
Copy link
Copy Markdown
Member

DJMcNab commented Apr 21, 2026

On mobile, so hard to check. Best guess is that it merges clean, so CI is running on the combined merge.

That behaviour sort of makes sense, but GitHub explains it exceedingly poorly; you have to infer what's going on.

So to rule that out, I'd try a rebase (or a fast forward merge? Idk, I always rebase)

@LaurenzV
Copy link
Copy Markdown
Collaborator

I think you probably just haven't rebased onto newest main, which contains the new opaque/alpha strips path.

Copy link
Copy Markdown
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

All seems reasonable to me, although this is a mobile only review, and I've not yet read the upstream changelog, so won't review it.

If I've not reviewed by 16:30ish Sydney time tomorrow, feel free to ping again here and/or on Zulip.

Comment thread .github/workflows/ci.yml
Comment thread examples/simple/src/main.rs Outdated
.expect("failed to get surface texture");
let surface_texture = match surface.surface.get_current_texture() {
CurrentSurfaceTexture::Success(surface_texture) => surface_texture,
CurrentSurfaceTexture::Outdated | CurrentSurfaceTexture::Suboptimal(_) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are reasonable arguments for still drawing to a suboptimal surface. I'm worried about the case where suboptimal means "use a different device", which would mean we would loop here (this is unvalidated, to be clear, as I'm on mobile)

Given that this is an example, I don't really care about it.

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.

Yeah, not sure. Either way, this seems better than panicking (which is what we were doing before). Handling the "should use a different device case" seems like it would be good to do in future (also for CurrentSurfaceTexture::Lost), but is probably quite rare in practice?

Comment thread examples/with_winit/src/lib.rs Outdated
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::GL,
..Default::default()
..wgpu::InstanceDescriptor::new_with_display_handle(Box::new(OurDisplayHandle))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not Box::new(DisplayHandle::web())? I don't think this example is quite so precious about memory usage. We could give a hint comment if we really wanted to.

Copy link
Copy Markdown
Contributor Author

@nicoburns nicoburns Apr 21, 2026

Choose a reason for hiding this comment

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

Because that wasn't valid until wgpu v29.0.1! But we should be able to change that now :)

Copy link
Copy Markdown
Contributor Author

@nicoburns nicoburns Apr 21, 2026

Choose a reason for hiding this comment

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

Hmm... actually this still isn't working, even with v29.0.1. I've reinstated this code. Issue is that DisplayHandle::web() isn't Send/Sync. I did have discussions with wgpu maintainers about removing this bound for WASM (which wgpu already does elsewhere), but I don't think this has actually happened yet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, apologies. Thanks for checking! If there's an upstream issue, we should link to it in a comment (not checked if you're already done this).

Comment thread sparse_strips/vello_hybrid/examples/wgpu_webgl/src/lib.rs Outdated
Comment thread sparse_strips/vello_hybrid/examples/wgpu_webgl/src/lib.rs Outdated
Comment thread sparse_strips/vello_hybrid/examples/winit/src/render_context.rs Outdated
Comment thread vello/src/util.rs
}

fn configure_surface(&self, surface: &RenderSurface<'_>) {
pub fn configure_surface(&self, surface: &RenderSurface<'_>) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this finally my impetus for killing this file entirely?

Either way, that shouldn't happen in this PR...

Copy link
Copy Markdown
Contributor Author

@nicoburns nicoburns Apr 21, 2026

Choose a reason for hiding this comment

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

I do now maintain https://docs.rs/wgpu_context as part of AnyRender which can potentially serve as a replacement (it would be annoying if vello depended on this, but a dev-dependency would be fine).

Signed-off-by: Nico Burns <nico@nicoburns.com>
@nicoburns nicoburns force-pushed the wgpu29 branch 2 times, most recently from b9d22ce to 2854169 Compare April 21, 2026 13:38
Signed-off-by: Nico Burns <nico@nicoburns.com>
@nicoburns
Copy link
Copy Markdown
Contributor Author

On mobile, so hard to check. Best guess is that it merges clean, so CI is running on the combined merge.
That behaviour sort of makes sense, but GitHub explains it exceedingly poorly; you have to infer what's going on.
So to rule that out, I'd try a rebase (or a fast forward merge? Idk, I always rebase)

(this was it. I had rebased on my local main, but I didn't have the latest locally - thanks for the help!)

Comment thread sparse_strips/vello_common/CHANGELOG.md Outdated
@nicoburns
Copy link
Copy Markdown
Contributor Author

If I've not reviewed by 16:30ish Sydney time tomorrow, feel free to ping again here and/or on Zulip.

@DJMcNab ping!

Copy link
Copy Markdown
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

I've not re-reviewed this - I'll aim to post-review next week. I've got an extra long weekend, so that won't be before Tuesday. But happy to land to let dependant PRs happen.

@nicoburns nicoburns added this pull request to the merge queue Apr 23, 2026
@nicoburns
Copy link
Copy Markdown
Contributor Author

I've not re-reviewed this - I'll aim to post-review next week. I've got an extra long weekend, so that won't be before Tuesday. But happy to land to let dependant PRs happen.

Cool. In that case I will merge now to avoid conflicts.

Merged via the queue into linebender:main with commit 9261917 Apr 23, 2026
17 checks passed
@nicoburns nicoburns deleted the wgpu29 branch April 23, 2026 22:58
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.

5 participants