bevy/examples/shader
charlotte a861452d68
Add user supplied mesh tag (#17648)
# Objective

Because of mesh preprocessing, users cannot rely on
`@builtin(instance_index)` in order to reference external data, as the
instance index is not stable, either from frame to frame or relative to
the total spawn order of mesh instances.

## Solution

Add a user supplied mesh index that can be used for referencing external
data when drawing instanced meshes.

Closes #13373

## Testing

Benchmarked `many_cubes` showing no difference in total frame time.

## Showcase



https://github.com/user-attachments/assets/80620147-aafc-4d9d-a8ee-e2149f7c8f3b

---------

Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
2025-02-10 22:38:13 +00:00
..
animate_shader.rs
array_texture.rs
automatic_instancing.rs
compute_shader_game_of_life.rs
custom_phase_item.rs
custom_post_processing.rs
custom_render_phase.rs
custom_shader_instancing.rs
custom_vertex_attribute.rs
extended_material.rs
fallback_image.rs
gpu_readback.rs
shader_defs.rs
shader_material_2d.rs
shader_material_bindless.rs
shader_material_glsl.rs
shader_material_screenspace_texture.rs
shader_material.rs
shader_prepass.rs
specialized_mesh_pipeline.rs
storage_buffer.rs
texture_binding_array.rs