mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
78bf48b874
# Objective - I've been using the `texture_binding_array` example as a base to use multiple textures in meshes in my program - I only realised once I was deep in render code that these helpers existed to create layouts - I wish I knew the existed earlier because the alternative (filling in every struct field) is so much more verbose ## Solution - Use `BindGroupLayoutEntries::with_indices` to teach users that the helper exists - Also fix typo which should be `texture_2d`. ## Alternatives considered - Just leave it as is to teach users about every single struct field - However, leaving as is leaves users writing roughly 29 lines versus roughly 2 lines for 2 entries and I'd prefer the 2 line approach ## Testing Ran the example locally and compared before and after. Before: <img width="1280" alt="image" src="https://github.com/bevyengine/bevy/assets/135186256/f5897210-2560-4110-b92b-85497be9023c"> After: <img width="1279" alt="image" src="https://github.com/bevyengine/bevy/assets/135186256/8d13a939-b1ce-4a49-a9da-0b1779c8cb6a"> Co-authored-by: mgi388 <> |
||
---|---|---|
.. | ||
animate_shader.rs | ||
array_texture.rs | ||
compute_shader_game_of_life.rs | ||
custom_vertex_attribute.rs | ||
extended_material.rs | ||
fallback_image.rs | ||
gpu_readback.rs | ||
post_processing.rs | ||
shader_defs.rs | ||
shader_instancing.rs | ||
shader_material.rs | ||
shader_material_2d.rs | ||
shader_material_glsl.rs | ||
shader_material_screenspace_texture.rs | ||
shader_prepass.rs | ||
texture_binding_array.rs |