bevy/examples/shader
Gilles Henaux ca25a67d0d
Fix the extended_material example on WebGL2 (#18812)
# Objective

- Fixes #13872 (also mentioned in #17167)

## Solution

- Added conditional padding fields to the shader uniform

## Alternatives

### 1- Use a UVec4

Replace the `u32` field in `MyExtension` by a `UVec4` and only use the
`x` coordinate.

(This was the original approach, but for consistency with the rest of
the codebase, separate padding fields seem to be preferred)

### 2- Don't fix it, unlist it

While the fix is quite simple, it does muddy the waters a tiny bit due
to `quantize_steps` now being a UVec4 instead of a simple u32. We could
simply remove this example from the examples that support WebGL2.

## Testing

- Ran the example locally on WebGL2 (and native Vulkan) successfully
2025-07-07 19:34:12 +00:00
..
animate_shader.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
array_texture.rs Remove incorrect equality comparisons for asset load error types (#15890) 2024-10-14 01:00:45 +00:00
automatic_instancing.rs Add user supplied mesh tag (#17648) 2025-02-10 22:38:13 +00:00
compute_shader_game_of_life.rs Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
custom_phase_item.rs Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
custom_post_processing.rs Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
custom_render_phase.rs Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
custom_shader_instancing.rs Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_vertex_attribute.rs Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
extended_material_bindless.rs Add bindless support back to ExtendedMaterial. (#18025) 2025-04-09 15:34:44 +00:00
extended_material.rs Fix the extended_material example on WebGL2 (#18812) 2025-07-07 19:34:12 +00:00
fallback_image.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
gpu_readback.rs Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
shader_defs.rs Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
shader_material_2d.rs Add alpha mode implementation to shader_material_2d (#16603) 2025-01-28 05:09:30 +00:00
shader_material_bindless.rs Use global binding arrays for bindless resources. (#17898) 2025-02-21 05:55:36 +00:00
shader_material_glsl.rs Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
shader_material_screenspace_texture.rs aligning public apis of Time,Timer and Stopwatch (#15962) 2024-10-16 21:09:32 +00:00
shader_material_wesl.rs Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
shader_material.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
shader_prepass.rs Update shader_prepass, testbed_2d, and first_person_view_model examples to use children! macro (#18270) 2025-03-22 22:35:20 +00:00
specialized_mesh_pipeline.rs Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
storage_buffer.rs Add user supplied mesh tag (#17648) 2025-02-10 22:38:13 +00:00
texture_binding_array.rs Type erased materials (#19667) 2025-06-27 22:57:24 +00:00