-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Web support #63
Draft
hecrj
wants to merge
8
commits into
master
Choose a base branch
from
feature/web-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Web support #63
Conversation
This file contains 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
Apparently, `gfx-backend-gl` cannot easily distinguish between single-layered texture arrays and normal textures.
Apparently, `BGRA` does not work properly. We should investigate why.
This was referenced Jul 2, 2019
This was referenced Sep 5, 2019
Merged
It seems that it was closed by rust-windowing/winit#1221, so it should be checked. I suspect that many other issues are solved by now too! |
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.
Depends on #62 and #60.
This PR allows Coffee to compile to Wasm! 🎉
Examples
I would greatly appreciate it if you report any issues you find!
Known issues
Implementation details
The changes basically use the new
gl
backend coming towgpu
to run graphics on the web using WebGL2.The PR uses my own forks of:
winit
– implements a newweb
platform with support forweb-sys
andstdweb
. Coffee uses theweb-sys
backend on web.gfx-backend-gl
– fixes some issues I have detected when dealing with WebGL. More specifically, it implements theCopyImageToSurface
command and it fixes a big memory leak.wgpu-native
– implements new wiring to support the newwinit
features.wgpu-rs
– adapts to the changes inwgpu-native
.wgpu_glyph
– fixes an issue withdrawArraysInstanced
in WebGL2 on Firefox.instant
– fixes anIllegal invocation
error when callingperformance.now()
. A fix should be merged soon (calling window for performance now sebcrozet/instant#5).This PR does not contain any additional breaking changes to the ones found in #62. The API remains unchanged, meaning web support will be mostly free for projects that are already using Coffee.
Pending work
winit
Wasm supportweb
errors rust-windowing/winit#1040gfx-backend-gl
fixesvertex_attrib_divisor
to0
when needed on GL backend gfx-rs/gfx#2887R8Unorm
format in GL backend gfx-rs/gfx#2891submit
in GL when there are no sync capabilities gfx-rs/gfx#2893wgpu-native
andwgpu-rs
wiring codewgpu_glyph
fixesinstant
fix (calling window for performance now sebcrozet/instant#5)gfx
backends to integrate with the newwinit
(and maybe contribute!)BGRA*
texture formats do not seem to worktwox-hash
has so many collisions on WasmFile::open
with an alternative on Wasmwinit
andwgpu
#62)wgpu
backend to latest API #60winit
andwgpu
#62