bevy/crates
mgi388 78bf48b874
Use BindGroupLayoutEntryBuilder in texture_binding_array example (#13169)
# 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 <>
2024-05-02 20:10:32 +00:00
..
bevy_a11y Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_animation Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_app Computed State & Sub States (#11426) 2024-05-02 19:36:23 +00:00
bevy_asset Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_audio Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_color Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_compile_test_utils Switch to ui_test in compile fail tests. (#12810) 2024-04-27 00:00:57 +00:00
bevy_core Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_core_pipeline Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_derive Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dev_tools Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_diagnostic Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dylib Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dynamic_plugin Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_ecs Computed State & Sub States (#11426) 2024-05-02 19:36:23 +00:00
bevy_ecs_compile_fail_tests Switch to ui_test in compile fail tests. (#12810) 2024-04-27 00:00:57 +00:00
bevy_encase_derive Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gilrs Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gizmos Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gltf Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_hierarchy Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_input Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_internal Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_log Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_macro_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_macros_compile_fail_tests Switch to ui_test in compile fail tests. (#12810) 2024-04-27 00:00:57 +00:00
bevy_math Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_mikktspace Update glam version requirement from 0.25 to 0.27 (#12757) 2024-05-02 18:42:34 +00:00
bevy_pbr Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_ptr Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_reflect Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_reflect_compile_fail_tests Switch to ui_test in compile fail tests. (#12810) 2024-04-27 00:00:57 +00:00
bevy_render Use BindGroupLayoutEntryBuilder in texture_binding_array example (#13169) 2024-05-02 20:10:32 +00:00
bevy_scene Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_sprite Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_tasks Remove async-task as a dependency (#13071) 2024-04-23 14:57:55 +00:00
bevy_text Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_time Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_transform Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_ui Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_window Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_winit fix: rewrite winit loop (#12669) 2024-05-02 19:57:19 +00:00