Comments (2)
I'm glad you are enjoying it, so far!
I haven't tried using a custom shader with the WebGL backend, but I can confidently say crashes are never expected. My first guess is that it could be relying on something that isn't quite working on WebGL yet.
Sample code (and maybe the backtrace or other error messages) would probably be helpful. But in the meantime, I could attempt to combine the two examples independently and see if I can reproduce the issue.
from pixels.
combine the two examples independently and see if I can reproduce the issue.
That's exactly what I did :) https://github.com/scambier/pixels-wasm-shader
I also got a more complete error message (I wasn't using run-wasm in my other project):
panicked at 'wgpu error: Validation Error
Caused by:
In Device::create_render_pipeline
note: label = `NoiseRenderer pipeline`
In the provided shader, the type given for group 0 binding 2 has a size of 4. As 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.
', C:\Users\cambi\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.15.1\src\backend\direct.rs:3024:5
Stack:
__wbg_get_imports/imports.wbg.__wbg_new_abda76e883ba8a5f@http://localhost:8000/minimal-web.js:330:21
console_error_panic_hook::hook::h511ef37bda845a46@http://localhost:8000/minimal-web_bg.wasm:wasm-function[1241]:0x17436a
core::ops::function::Fn::call::h66d1e3935af5c573@http://localhost:8000/minimal-web_bg.wasm:wasm-function[4266]:0x1d3e97
std::panicking::rust_panic_with_hook::h7f7102b82d51338f@http://localhost:8000/minimal-web_bg.wasm:wasm-function[1978]:0x1ac9b5
std::panicking::begin_panic_handler::{{closure}}::hfa40135feb109919@http://localhost:8000/minimal-web_bg.wasm:wasm-function[2190]:0x1b6b3c
std::sys_common::backtrace::__rust_end_short_backtrace::haf21bfec9a028e09@http://localhost:8000/minimal-web_bg.wasm:wasm-function[4259]:0x1d3e5d
rust_begin_unwind@http://localhost:8000/minimal-web_bg.wasm:wasm-function[2667]:0x1c4fbd
core::panicking::panic_fmt::he4489d678d6570d5@http://localhost:8000/minimal-web_bg.wasm:wasm-function[3026]:0x1cbb99
core::ops::function::Fn::call::h099d1bcc0b598391@http://localhost:8000/minimal-web_bg.wasm:wasm-function[1989]:0x1ad36e
wgpu::backend::direct::ErrorSinkRaw::handle_error::hb0cb284e44b181f3@http://localhost:8000/minimal-web_bg.wasm:wasm-function[1453]:0x1896cd
<wgpu::backend::direct::Context as wgpu::context::Context>::device_create_render_pipeline::h1bc78c2675dacf7a@http://localhost:8000/minimal-web_bg.wasm:wasm-function[426]:0xaa0dc
<T as wgpu::context::DynContext>::device_create_render_pipeline::hae3fcc79374be9e2@http://localhost:8000/minimal-web_bg.wasm:wasm-function[2589]:0x1c3260
wgpu::Device::create_render_pipeline::hc5455132d86d4932@http://localhost:8000/minimal-web_bg.wasm:wasm-function[2078]:0x1b1b88
minimal_web::renderers::NoiseRenderer::new::hc3146e734bd43e9a@http://localhost:8000/minimal-web_bg.wasm:wasm-function[524]:0xe19f3
minimal_web::run::{{closure}}::h1c571aba69f7d21d@http://localhost:8000/minimal-web_bg.wasm:wasm-function[383]:0x764d8
wasm_bindgen_futures::task::singlethread::Task::run::h5e9f49afb58daace@http://localhost:8000/minimal-web_bg.wasm:wasm-function[1983]:0x1acd7e
wasm_bindgen_futures::queue::Queue::new::{{closure}}::h5792ce7fa23a89dd@http://localhost:8000/minimal-web_bg.wasm:wasm-function[1250]:0x175377
<dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h7f1f5bef6806f9cf@http://localhost:8000/minimal-web_bg.wasm:wasm-function[3489]:0x1d0b5f
__wbg_adapter_46@http://localhost:8000/minimal-web.js:225:10
real@http://localhost:8000/minimal-web.js:202:20
minimal-web.js:346:21
It looks like it's fixable directly in the shader code gfx-rs/wgpu#2832
That's a good excuse to learn a bit of wgsl and try to fix that myself 👍
from pixels.
Related Issues (20)
- How to make the pixel buffer larger than the window HOT 7
- Pixels no longer handles scaling factors correctly. HOT 10
- imgui UI out of bounds in example "imgui-winit" HOT 2
- Instant crash on MacOS when window is shrunk vertically HOT 4
- pixels.render() fails randomly HOT 7
- using `pixels.resize_surface` to decrease the height of the buffer will panic HOT 2
- `pixels` panics when using egui HOT 6
- The "minimal-tao" example not working on Linux HOT 3
- Error: AdapterNotFound HOT 5
- Web Example: Possible to occupy all available space ? Key Input HOT 2
- Premultiplication with `tiny-skia` HOT 2
- Feature request: Getting window position from pixel position HOT 1
- Android example HOT 1
- Black screen on Ubuntu 23 within VMWare Workstation 17 HOT 5
- Transparent windows don't work due to hardcoded alpha mode HOT 2
- No possibility of changing the surface `PresentMode` without recreating the whole `Pixels` instance HOT 3
- Not able to create pixel buffer with winit 0.29.2 HOT 8
- Using pixels with eframe HOT 4
- Invaders example doesn't work when using pixels from crates.io HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixels.