bevy/assets/shaders
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.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
array_texture.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
automatic_instancing.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
bindless_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
cubemap_unlit.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_clustered_decal.wgsl Implement basic clustered decal projectors. (#17315) 2025-01-26 20:13:39 +00:00
custom_gltf_2d.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
custom_material_2d.wgsl Fix binding group in custom_material_2d.wgsl (#10841) 2023-12-02 22:21:53 +00:00
custom_material_import.wgsl fix custom shader imports (#10030) 2023-10-06 01:34:57 +00:00
custom_material_screenspace_texture.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_material.frag Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_material.vert Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_material.wesl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_phase_item.wgsl Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 16:13:03 +00:00
custom_stencil.wgsl Add a custom render phase example (#16916) 2025-02-10 21:17:37 +00:00
custom_ui_material.wgsl ui_material example webgl2 fix (#17852) 2025-02-13 20:52:26 +00:00
custom_vertex_attribute.wgsl Add comment to custom vertex attribute example to make it easier to convert to 2D (#18603) 2025-07-07 19:26:37 +00:00
extended_material_bindless.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
extended_material.wgsl Fix the extended_material example on WebGL2 (#18812) 2025-07-07 19:34:12 +00:00
fallback_image_test.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
game_of_life.wgsl Fix game_of_life shader relying on Naga bug (#18951) 2025-04-26 21:38:08 +00:00
gpu_readback.wgsl Gpu readback (#15419) 2024-09-30 17:28:55 +00:00
instancing.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
irradiance_volume_voxel_visualization.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
line_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
manual_material.wgsl Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
post_processing.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
shader_defs.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
show_prepass.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
specialized_mesh_pipeline.wgsl Fix non-crate typos (#18219) 2025-03-11 06:17:48 +00:00
storage_buffer.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
texture_binding_array.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
tonemapping_test_patterns.wgsl Fix non-crate typos (#18219) 2025-03-11 06:17:48 +00:00
util.wesl Fix wesl in wasm and webgl2 (#18591) 2025-03-28 21:45:02 +00:00
water_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00