fix: provide default display handle for web canvas surface targets - #9476
Merged
Conversation
inner-daemons
self-requested a review
May 6, 2026 15:22
Collaborator
|
@cwfitzgerald Can you rerun the CI |
andyleiserson
approved these changes
May 13, 2026
andyleiserson
left a comment
Contributor
There was a problem hiding this comment.
Seems like we may have a test coverage gap, but since this is a regression I won't block on that.
5 tasks
Contributor
|
I assume, this is also something that won't be backported to 29.x, so we'd have to skip straight to 30 with ruffle-rs/ruffle#24229? |
Member
|
Correct, I don't think this was ever backported |
Contributor
|
Alright, anyway, I think it's possible to workaround at least. |
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.
Description
Since
wgpuversion 29, creating a surface from a web canvas usingInstance::create_surfacewithSurfaceTarget::CanvasorSurfaceTarget::OffscreenCanvasfails withCreateSurfaceError::MismatchingDisplayHandle.This occurs because both
SurfaceTarget::CanvasandSurfaceTarget::OffscreenCanvassetraw_display_handle: None. However, inwgpu_core::instance::Instance::create_surface, there is a requirement that eitherinstance_display_handleordisplay_handlemust be present. Sinceraw_display_handleis alwaysNone, it always matches the(None, None) => return Err(CreateSurfaceError::MissingDisplayHandle)arm.Note: this change does not affect the examples (
examples/features) because it utilizeswinitwhich provides a validRawDisplayHandlewhen creating windows (including web canvases) and which never hits the(None, None)case.Testing
Tested in browser using:
Squash or Rebase?
Squash