-
Notifications
You must be signed in to change notification settings - Fork 946
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
WebGL2 backend #1617
Comments
I'm going to start working on this as I have the time. So far I got it compiling, but haven't tested it yet. |
It would be very useful to get in touch with you on more immediate channels than Github. Please consider joining Matrix or Discord! |
@zicklag Hi! A couple of notes, that, maybe, helps you a little bit with your journey :)
|
Got some help on Matrix ( thanks guys! ), and with gfx-rs/naga#1100 the shader problem I was stuck on was fixed. After that I got to a blank screen for the cube example ( no more panic! ): It's got an invalid operation I've got to investigate, but we got past the shader problems! |
@zicklag This was fixed in gfx-rs/gfx#3682. From WebGL docs:
I guess, you can use |
@Gordon-F Ah, cool, thanks. I had already started copying that code from the gfx backend. So far grabbing the And...We've got a cube! Apparently my browser is using mesa for the WebGL implementation and runs into the same fastclear bug ( #1627 ), but I think something else is wrong, too, because the color is still wrong with fastclear disabled. I'm going to look into that a little more. Also, a quick test of the shadow example yields: |
The fact the error is talking about the vertex stage is erroneous. As it stands now, the shadow example cannot run on WebGL at all as it uses SSBOs and WebGL doesn't support SSBOs. That being said, it doesn't actually need to use SSBOs, it could totally use a uniform buffer for what it is doing. |
Would it be good to switch it to a uniform for web and desktop, or do we want it using SSBOs for the sake of demonstrating GPU features? |
Let's have the shader with 2 different vs entry points: one using a storage buffer, and another using a uniform buffer at exactly the same binding.
The Rust side can check downlevel features and adjust the selected entry point as well as the bind group accordingly.
… On Jul 17, 2021, at 15:37, Zicklag ***@***.***> wrote:
That being said, it doesn't actually need to use SSBOs, it could totally use a uniform buffer for what it is doing.
Would it be good to switch it to a uniform for web and desktop, or do we want it using SSBOs for the sake of demonstrating GPU features?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
If you compile WGPU for web, how do we want to indicate that you want support for WebGPU or WebGL or both? Right now if you compile for web, it just assumes WebGPU and there's no way to disable it ( if I've interpreted that correctly ). Since it's just passthrough to the browser is that probably fine, or do we want a Also, if we pass in the WebGL flag do we want it to keep the WebGPU backend, too. So that, unless otherwise specified by the user's On a related topic, does anybody else get a problem trying to compile WGPU master for WASM? I'm getting tons of errors like the
Edit: Building the docs with the following command also only shows so many types enabled. I wonder if it's like winit's selected features are the only ones being applied. Maybe this has something to do the Cargo resolver version 2.
Edit2: Now I'm even more confused. CI seems to be running just fine, but I can't get this command to complete locally without tons of errors:
|
IMO it should be the other way around, so people would opt-in to using WebGL as fallback somehow and we always assume WebGPU is available by default. We had a feature for opting into WebGL previously but not sure if it's still there after the gfx-hal -> wgpu-hal migration.
You need to use |
Ah, that works!
The only issue I have with that is actually that building the WebGPU wrapper requires that |
Hi all! I asked this on the Wgpu Users channel but maybe it's better to track on github: In short, I'm just curious if the WebGL2 backend is considered stable enough for production at this point, and if it is maybe I'm doing something wrong? |
Replied in a new discussion: #3003 (comment). |
Is your feature request related to a problem? Please describe.
The new GLES3 backend landed in #1510
Now we need to enable the Web target for WebGL2.
Describe the solution you'd like
On "wasm32-unknown-unknown" target the GLES backend should target WebGL2, just like the old "gfx-backend-gl" did.
Describe alternatives you've considered
Having a separate feature for this, may still be a good idea in order to help the
cargo-vendor
volume.Additional context
Required for Bevy
The text was updated successfully, but these errors were encountered: