Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass correct surface for existing canvases #3718

Merged
merged 1 commit into from
Apr 30, 2023

Conversation

grovesNL
Copy link
Collaborator

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
Fixes #3710

Description
We were passing the (id, data) tuple instead of data which was expected. This was hard to spot because we use Any for surface types, so it eventually results in a downcast_ref much later. We should try to improve type safety here after we figure out how Arc will be integrated with the WebGPU backend.

Testing
Tested by modifying hello-triangle to create the surface from a canvas instead of a handle.

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

thank you!

@cwfitzgerald cwfitzgerald merged commit 66c029f into gfx-rs:trunk Apr 30, 2023
gents83 added a commit to gents83/wgpu that referenced this pull request Apr 30, 2023
Pass correct surface for existing canvases (gfx-rs#3718)
@cwfitzgerald cwfitzgerald added the PR: needs back-porting PR with a fix that needs to land on crates label May 3, 2023
Wumpf pushed a commit to rerun-io/wgpu that referenced this pull request May 14, 2023
@Wumpf Wumpf mentioned this pull request May 14, 2023
3 tasks
@cwfitzgerald cwfitzgerald removed the PR: needs back-porting PR with a fix that needs to land on crates label Sep 27, 2023
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.

wgpu(web) assertion failed: data.is::<T>()
3 participants