bevy/examples/shader
charlotte 181445c56b
Add support for experimental WESL shader source (#17953)
# Objective

WESL's pre-MVP `0.1.0` has been
[released](https://docs.rs/wesl/latest/wesl/)!

Add support for WESL shader source so that we can begin playing and
testing WESL, as well as aiding in their development.

## Solution

Adds a `ShaderSource::WESL` that can be used to load `.wesl` shaders.

Right now, we don't support mixing `naga-oil`. Additionally, WESL
shaders currently need to pass through the naga frontend, which the WESL
team is aware isn't great for performance (they're working on compiling
into naga modules). Also, since our shaders are managed using the asset
system, we don't currently support using file based imports like `super`
or package scoped imports. Further work will be needed to asses how we
want to support this.

---

## Showcase

See the `shader_material_wesl` example. Be sure to press space to
activate party mode (trigger conditional compilation)!


https://github.com/user-attachments/assets/ec6ad19f-b6e4-4e9d-a00f-6f09336b08a4
2025-03-09 19:26:55 +00:00
..
animate_shader.rs
array_texture.rs
automatic_instancing.rs Add user supplied mesh tag (#17648) 2025-02-10 22:38:13 +00:00
compute_shader_game_of_life.rs
custom_phase_item.rs Cache MeshInputUniform indices in each RenderBin. (#17772) 2025-02-11 22:38:52 +00:00
custom_post_processing.rs
custom_render_phase.rs Retain skins from frame to frame. (#17818) 2025-02-18 00:56:04 +00:00
custom_shader_instancing.rs Use multi_draw_indirect_count where available, in preparation for two-phase occlusion culling. (#17211) 2025-01-14 21:19:20 +00:00
custom_vertex_attribute.rs
extended_material.rs
fallback_image.rs
gpu_readback.rs Allowed creating uninitialized images (for use as storage textures) (#17760) 2025-02-10 22:22:07 +00:00
shader_defs.rs
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 Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
shader_material_screenspace_texture.rs
shader_material_wesl.rs Add support for experimental WESL shader source (#17953) 2025-03-09 19:26:55 +00:00
shader_material.rs
shader_prepass.rs
specialized_mesh_pipeline.rs Combine output_index and indirect_parameters_index into one field in PreprocessWorkItem. (#17853) 2025-02-13 20:10:14 +00:00
storage_buffer.rs Add user supplied mesh tag (#17648) 2025-02-10 22:38:13 +00:00
texture_binding_array.rs Make StandardMaterial bindless. (#16644) 2024-12-10 17:48:56 +00:00