-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Update egui to 0.25, wgpu to 0.19 and fix Firefox compatibility #88
Conversation
Guess what? wgpu finally has support for having both WebGPU and WebGL in the same binary, so we won't need to make a separate build for WebGPU and WebGL anymore! We still need to wait for gfx-rs/wgpu#5044 to reach a stable release of wgpu, though. |
Iirc wgpu plans to release 0.19 on the 17th, hopefully we don't need to wait long! |
wgpu 0.19 released but it's not compatible with the version of winit that eframe 0.24 uses. I'll wait until catppuccin-egui upgrades to at least egui 0.25 and then upgrade egui, eframe and wgpu here. |
I'll get working on the |
Chances are when the wgpu update changes land into a stable release of egui, they're going to use a squash merge, so we have no choice but to use commits from the egui master branch as the base commits for merges.
catppuccin-egui updated to egui 0.25 today so I've updated everything and changed the web build to make one binary with both WebGPU and WebGL support. wgpu 0.19 also comes with gfx-rs/wgpu#4607 which supposedly fixes the DX12 push constant bugs we'd experienced, so I've also removed the disabling of push constants on DX12. Needs testing on Windows with DX12 to see if it can run without crashing. |
This allows easily serving Luminol web builds under any path (e.g. https://example.com/luminol/ instead of https://example.com/).
Upon further testing, it seems the crash reporter actually can send crash reports to both localhost and non-localhost URLs without errors in Firefox. You just can't send crash reports anywhere while offline in Firefox, even to localhost, due to the bug mentioned in #111. I was probably testing sending to localhost while offline before. |
Description
This pull request adds support for Firefox if the user installs an extension enabling the File System Access API, by fixing some minor unrelated compatibility issues. Safari is still not supported because I couldn't find an extension for Safari and it also doesn't support credentialless COEP.
This is the extension for Firefox: https://github.com/ichaoX/ext-file.
You should be using at least Firefox 119 (released 2023-10-24) because that's the first version that supports credentialless COEP by default. Firefox 104 (released 2022-08-23) and later support credentialless COEP as well, but it was just an origin trial back then and needs to be explicitly enabled in about:config (browser.tabs.remote.coep.credentialless).
Additionally, Firefox 114 (released 2023-06-06) or later is required for ES6 modules to work in web workers, so in summary the earliest version of Firefox supported by default is 119 and the earliest version supported with changes to about:config is 114. Theoretically we could support older versions of Firefox (104 or later) by refactoring the code to remove ES6 modules and then passing
--target no-modules
to wasm-bindgen, but I don't think this will be worth the effort given that we still need a lot more time to get Luminol to be a drop-in replacement for even RPG Maker XP.Firefox's stable releases don't have WebGPU support at all yet, and Firefox Nightly only has support on the main thread and not in web workers where Luminol performs rendering, so I've changed the autobuild workflow for WebAssembly to also make a WebGL fallback build with the method I described in #52. For local testing, make sure to run Trunk with
--features webgl
.The performance of the recursive directory search after loading projects is poor, but I have plans to fix this in another pull request.A lazy path cache was implemented in #90 to improve the performance of Luminol in Firefox.I've also added checks (in assets/compat-test.js) for two things: secure context and Firefox private browsing. "Secure context" means either the website is being served over localhost or it's not localhost but being accessed through HTTPS rather than HTTP. We need a secure context because the File System Access API and a few other important APIs are not available outside of secure contexts. Firefox private browsing is checked for because service workers are not available in Firefox's private browsing mode and so coi-serviceworker.js won't be able to enable cross-origin isolation and allow us to use multithreading.
The crash reporter from #87 should also work in Firefox once this is merged, but for some reason it can only send reports to non-localhost URLs. If you try sending a report to localhost, the report will reach the server but Luminol will always say that the request failed.
Testing
Make sure to run Trunk with
--features webgl
and install the Firefox extension.Open Luminol in Firefox 119 or later and check that the following things work. I've already tested all of these but it would be a good idea to test them again, especially on a non-Linux machine.
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
cargo build --release
trunk build --release