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
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
custom_gltf_2d.wgsl
custom_material_2d.wgsl
custom_material_import.wgsl
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
custom_stencil.wgsl
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
instancing.wgsl
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
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