use sequential bindings in bevy_sprite (#19830)

# Objective

- Use the terser api

## Solution

- Use the terser api

## Testing

- run sprite example it works
This commit is contained in:
atlv 2025-06-27 02:59:02 -04:00 committed by GitHub
parent 5fabb5343d
commit a256d3398a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 31 deletions

View File

@ -293,19 +293,13 @@ impl FromWorld for Mesh2dPipeline {
let tonemapping_lut_entries = get_lut_bind_group_layout_entries();
let view_layout = render_device.create_bind_group_layout(
"mesh2d_view_layout",
&BindGroupLayoutEntries::with_indices(
&BindGroupLayoutEntries::sequential(
ShaderStages::VERTEX_FRAGMENT,
(
(0, uniform_buffer::<ViewUniform>(true)),
(1, uniform_buffer::<GlobalsUniform>(false)),
(
2,
tonemapping_lut_entries[0].visibility(ShaderStages::FRAGMENT),
),
(
3,
tonemapping_lut_entries[1].visibility(ShaderStages::FRAGMENT),
),
uniform_buffer::<ViewUniform>(true),
uniform_buffer::<GlobalsUniform>(false),
tonemapping_lut_entries[0].visibility(ShaderStages::FRAGMENT),
tonemapping_lut_entries[1].visibility(ShaderStages::FRAGMENT),
),
),
);
@ -755,11 +749,11 @@ pub fn prepare_mesh2d_view_bind_groups(
let view_bind_group = render_device.create_bind_group(
"mesh2d_view_bind_group",
&mesh2d_pipeline.view_layout,
&BindGroupEntries::with_indices((
(0, view_binding.clone()),
(1, globals.clone()),
(2, lut_bindings.0),
(3, lut_bindings.1),
&BindGroupEntries::sequential((
view_binding.clone(),
globals.clone(),
lut_bindings.0,
lut_bindings.1,
)),
);

View File

@ -63,18 +63,12 @@ impl FromWorld for SpritePipeline {
let tonemapping_lut_entries = get_lut_bind_group_layout_entries();
let view_layout = render_device.create_bind_group_layout(
"sprite_view_layout",
&BindGroupLayoutEntries::with_indices(
&BindGroupLayoutEntries::sequential(
ShaderStages::VERTEX_FRAGMENT,
(
(0, uniform_buffer::<ViewUniform>(true)),
(
1,
tonemapping_lut_entries[0].visibility(ShaderStages::FRAGMENT),
),
(
2,
tonemapping_lut_entries[1].visibility(ShaderStages::FRAGMENT),
),
uniform_buffer::<ViewUniform>(true),
tonemapping_lut_entries[0].visibility(ShaderStages::FRAGMENT),
tonemapping_lut_entries[1].visibility(ShaderStages::FRAGMENT),
),
),
);
@ -636,11 +630,7 @@ pub fn prepare_sprite_view_bind_groups(
let view_bind_group = render_device.create_bind_group(
"mesh2d_view_bind_group",
&sprite_pipeline.view_layout,
&BindGroupEntries::with_indices((
(0, view_binding.clone()),
(1, lut_bindings.0),
(2, lut_bindings.1),
)),
&BindGroupEntries::sequential((view_binding.clone(), lut_bindings.0, lut_bindings.1)),
);
commands.entity(entity).insert(SpriteViewBindGroup {