bevy/crates/bevy_ui/src
François Mockers 4065098586
Fix UI in WebGPU: call textureSample from outside the if (#13546)
# Objective

- since #13523, UI is broken in WebGPU

```
Compilation log for [Invalid ShaderModule (unlabeled)]:
1 error(s) generated while compiling the shader:
:108:27 error: 'textureSample' must only be called from uniform control flow
    let texture_color_1 = textureSample(sprite_texture, sprite_sampler, in_2.uv);
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:151:19 note: called by 'draw_background' from 'fragment'
        let _e5 = draw_background(in);
                  ^^^^^^^^^^^^^^^^^^^

:147:5 note: control flow depends on possibly non-uniform value
    if _e3 {
    ^^

:146:23 note: parameter 'in' of 'fragment' may be non-uniform
    let _e3 = enabled(in.flags, BORDER);
```


## Solution

- call `textureSample` from outside the if. both branches are using the
same parameters
2024-05-29 23:03:57 +00:00
..
layout Upgrade to Taffy 0.4 (#10690) 2024-04-30 14:13:17 +00:00
render Fix UI in WebGPU: call textureSample from outside the if (#13546) 2024-05-29 23:03:57 +00:00
widget Upgrade to Taffy 0.4 (#10690) 2024-04-30 14:13:17 +00:00
accessibility.rs fix: use try_insert instead of insert in bevy_ui to prevent panics when despawning ui nodes (#13000) 2024-04-19 18:12:08 +00:00
focus.rs don't attempt to set cursor relative position for zero sized nodes (#12395) 2024-03-10 02:18:40 +00:00
geometry.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
lib.rs Run CheckVisibility after all the other visibility system sets have… (#12962) 2024-04-18 20:33:29 +00:00
measurement.rs Upgrade to Taffy 0.4 (#10690) 2024-04-30 14:13:17 +00:00
node_bundles.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
stack.rs Reduce steady-state allocations in ui_stack_system (#12413) 2024-03-12 13:57:57 +00:00
texture_slice.rs fix: use try_insert instead of insert in bevy_ui to prevent panics when despawning ui nodes (#13000) 2024-04-19 18:12:08 +00:00
ui_material.rs Fix incorrect link in UiMaterial documentation (#12361) 2024-03-07 22:09:57 +00:00
ui_node.rs Upgrade to Taffy 0.4 (#10690) 2024-04-30 14:13:17 +00:00
update.rs fix: use try_insert instead of insert in bevy_ui to prevent panics when despawning ui nodes (#13000) 2024-04-19 18:12:08 +00:00