-
Notifications
You must be signed in to change notification settings - Fork 948
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
Vertex shaders with derivative functions in dead code fail to compile on WebGL #4368
Comments
@JCapucho aren't we filtering out the functions unused by the entry point? |
Hmm, weird seems like we at some point removed it and are just printing everything |
I just hit this bug. We usually put the vertex shader and fragment shader in the same |
I have also hit this issue while trying to run https://github.com/james-j-obrien/bevy_vector_shapes on web. |
* transform cache now deals with Affine3 matrices only * use a perspective camera in 2d views that sit at a space camera * clarify/simplify use of focal length * refine camera plane distance heuristic for 2D scenes and make it configurable again * comment wip * merge fixup and comment improvements * line & point builder now work with affine transforms * wip * improved image plane heuristic for 2D * hack for image plane distance for in inverse pinhole transforms. remove setting from ui again for 2d views * add viewport transformation to viewbuilder * better viewport transform * limit zoom, correctly handle ui scale under viewport zoom * 2D points now draw as real 2D circles * better 2D rendering for lines with perspective camera around * disable 3D labels in 2D views * space camera no longer required for correct pinhole camera in ui_2d * consistent canvas rect handling, take principal point into account when displaying 2d canvas * comments on the nature of our interim 3D->2D solution * point out that picking should use same transforms * easier point/line flag building * minor cleanup * doc test fix * clarify what sphere_quad's coverage methods do * fix taking only one axis into account for pixel size approximation * comment explaining how to use FORCE_ORTHO_SPANNING * remove unnecessary affine3a multiply method * impl From<glam::Affine3A> for wgpu_buffer_types::Mat4 * rename rect top_left to min * remove unnecessary quaternion on pinhole transform calc * make error swallowing on screenshots more explicit * failure to compute camera now logs error and stops from rendering * note on non-square pixels * better handle different x & y focal length + comment * renaming and tests around RectTransform * yet another workaround for https://github.com/gfx-rs/naga/issues/1743 * remove h word
This has been fixed by gfx-rs/naga#2531. |
Description
If a wgsl shader contains a function with
fwidth
,dpdx
ordpdy
in it and that shader file is used as both a vertex and a fragment shader (just with different entry points), the shader fails in validation on WebGL even if the function is not used from the vertex shader.i.e.
Repro steps
cargo install wasm-server-runner
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-server-runner cargo run --target wasm32-unknown-unknown --example mesh2d_manual
Expected behavior
I'd expect to see a pretty dark star (with some color on it) in the middle of the browser window.
Observed behavior
No star,
Extra materials
For what it's worth, it works fine on native (
cargo run --example mesh2d_manual
)I don't understand the stack that well, but I assume this could be worked around by at some level trying to figure out whether
fwidth
and friends is called from a function that is unreachable by the entry point and in that case skip it.Platform
The text was updated successfully, but these errors were encountered: