mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
The Egui web example was throwing an error in WGPU. In this case, the error was ``` panicked at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-30.0.0/src/backend/wgpu_core.rs:1414:26: wgpu error: Validation Error Caused by: In Device::create_render_pipeline, label = ‘egui_pipeline’ In the provided shader, the type given for group 1 binding 2 has a size of 4. Since the device does not support DownlevelFlags::BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED`, the type must have a size that is a multiple of 16 bytes ``` One reference I used was the following Pull Request: <https://github.com/viridia/quill/pull/14> The biggest change I made was in `egui-wgpu` to `r_tex_nearest_filtering` Shader (`egui.wgsl`) ```wgsl // Old @group(1) @binding(2) var<uniform> r_tex_nearest_filtering: u32; // New @group(1) @binding(2) var<uniform> r_tex_nearest_filtering: vec4<u32>; ``` And with the corresponding changes in `renderer.rs`, I ran it locally and it worked perfectly in Firefox 149 and Chromium 151 (Both fail when attempting to access https://www.egui.rs/#demo, returning the error described above) * Closes <https://github.com/emilk/egui/issues/8446> * Fixes <https://github.com/emilk/egui/issues/8446> * [X] I have followed the instructions in the PR template --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
egui-wgpu
This crates provides bindings between egui and wgpu.
This was originally hosted at https://github.com/hasenbanck/egui_wgpu_backend