-
-
Notifications
You must be signed in to change notification settings - Fork 812
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
wgpu: Allow wgpu on web and various improvements #5250
Conversation
c61bc2e
to
acd9816
Compare
About the surface format issue: My experience was that only sRGBA formats were supported on OpenGL. |
0872c43
to
09c3418
Compare
Bumped to wgpu 0.11. |
After the bump to 0.11, it still works fine for me on native Linux; on both Vulkan with HW acceleration, and on OpenGL - with or without HW acceleration.
|
f0ccfca
to
af662b0
Compare
I've converted all of the shaders over to WSGL. I don't think it's worth waiting for DX11 support, so this is more or less ready to go; unfortunately I'm getting errors on DX12 at the moment that I need to investigate. @torokati44 Could you give this another try on your machine with OpenGL? |
Still works fine for me on all four [OpenGL, Vulkan] x [HW, SW] combinations. |
BTW is running with DX11 any better than OpenGL on Windows? |
Unfortunately wgpu OpenGL backend doesn't function on Windows (it uses egl for the context management, it would need to use wgl on Windows). And I don't think it's really on their roadmap to support OpenGL on Windows. I don't know what machines would support DX11 but not DX12; DX12 was back-ported to Windows 7, and I think even integrated GPUs would support both DX11 and 12. But not 100% sure. |
To answer my own question a little bit, Intel provides this page indicating which APIs their chips support: You actually don't need to fully support DX12 feature set to use DirectX 12; the versions are more like feature levels nowadays, and ostensibly you can use the DirectX12 API with the DX11 feature set. wgpu itself only requests HD Graphics 2000 is the first to only support DX10, and that's dating to 2011, so I think that's far enough back to be okay ignoring it. |
My DX12 issue mentioned above was kindly fixed in gfx-rs/wgpu#2103. Unfortunately as far as Win7 goes, looks like Microsoft's D3D12on7 wrapper is required to use DX12 API on older Windows -- I mistakenly thought MS had seamlessly backported it. So this would require these pre-Win10 users to have Vulkan. Consulting back to the Intel support page, the chipsets that supposedly support Vulkan date back to only ~2015. |
49a61f8
to
e327400
Compare
This will be necessary for using wgpu on web, where the whole renderer creation will need to be async.
Enable web_sys_unstable_apis RUSTFLAGS in .cargo/config.toml. These are necessary to use WebGPU in the browser, as well as other features such as clipboard.
Add wgpu feature to web build (disabled by default currently).
This backend has not yet been reimplemented in wgpu 0.10+, so disallow it for now.
wgpu only supports OpenGL on Linux, so provide a better message if a user tries to use the GL backend on Windows/macOS.
Let's go ahead and merge this, with pre-emptive apologies to any users on older Win 7 systems. |
The switch to 8081 seems like a leftover from ruffle-rs#5250. Return to the default 8080.
The switch to 8081 seems like a leftover from #5250. Return to the default 8080.
This is working towards several wgpu changes:
wgpu
feature added toruffle_web
.Let's hold off on merging this until either the DX11 backend is re-enabled, or the OpenGL backend works on Windows.