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

[wasm] Fix raw handles, delay getContext call to be WebGPU compatible #368

Merged
merged 7 commits into from
Oct 5, 2024

Conversation

Wumpf
Copy link
Contributor

@Wumpf Wumpf commented Oct 5, 2024

Also, fixed various warnings & added a CI step to check the wasm target.

The reason getContext have to be delayed here is that this stateful: Once getContext is called with one type of context (2d, webgl or webgpu), any future call with a different type will fail.
-> Previously, it was not possible to use the canvas with a WebGL/WebGPU context since minifb would call .get_context("2d") during initialization.

Tested this on https://github.com/Wumpf/minifb_wgpu_web_and_desktop (at Wumpf/minifb_wgpu_web_and_desktop@e39be06)

@Wumpf Wumpf changed the title [wasm] Fix raw handles, delay getContext call to be WebGPU comptible [wasm] Fix raw handles, delay getContext call to be WebGPU compatible Oct 5, 2024
@Wumpf
Copy link
Contributor Author

Wumpf commented Oct 5, 2024

ah the ci config didn't age well, have to fix this up

@Wumpf Wumpf force-pushed the fix-wasm-raw-handle branch from 50777e3 to 37307d9 Compare October 5, 2024 15:53
@Wumpf
Copy link
Contributor Author

Wumpf commented Oct 5, 2024

done!
Couldn't have asked for a better example why the ci check is needed than the unwrap_or(return false) that slipped onto master meanwhile ;-)

@emoon emoon merged commit b20aaa9 into emoon:master Oct 5, 2024
4 checks passed
@emoon
Copy link
Owner

emoon commented Oct 5, 2024

Awesome! Thanks for the fixes :)

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.

2 participants