bevy/crates/bevy_ui/src/render
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
..
mod.rs Fix various bugs with UI rounded borders (#13523) 2024-05-27 17:42:13 +00:00
pipeline.rs Add border radius to UI nodes (adopted) (#12500) 2024-03-19 22:44:00 +00:00
render_pass.rs Make render phases render world resources instead of components. (#13277) 2024-05-21 18:23:04 +00:00
ui.wgsl Fix UI in WebGPU: call textureSample from outside the if (#13546) 2024-05-29 23:03:57 +00:00
ui_material.wgsl Include UI node size in the vertex inputs for UiMaterial. (#11722) 2024-02-06 16:15:09 +00:00
ui_material_pipeline.rs Make render phases render world resources instead of components. (#13277) 2024-05-21 18:23:04 +00:00
ui_vertex_output.wgsl Include UI node size in the vertex inputs for UiMaterial. (#11722) 2024-02-06 16:15:09 +00:00