From e98fe0a01c5873d988903d2a96315b5606def7c9 Mon Sep 17 00:00:00 2001 From: charlotte Date: Mon, 31 Mar 2025 11:07:20 -0700 Subject: [PATCH] Fix mesh tag feature for 2d. (#18636) # Objective Fixes #18564 --- crates/bevy_sprite/src/mesh2d/mesh2d_functions.wgsl | 4 ++++ crates/bevy_sprite/src/mesh2d/mesh2d_types.wgsl | 1 + 2 files changed, 5 insertions(+) diff --git a/crates/bevy_sprite/src/mesh2d/mesh2d_functions.wgsl b/crates/bevy_sprite/src/mesh2d/mesh2d_functions.wgsl index 0b99482211..dbd73fb171 100644 --- a/crates/bevy_sprite/src/mesh2d/mesh2d_functions.wgsl +++ b/crates/bevy_sprite/src/mesh2d/mesh2d_functions.wgsl @@ -43,3 +43,7 @@ fn mesh2d_tangent_local_to_world(world_from_local: mat4x4, vertex_tangent: vertex_tangent.w ); } + +fn get_tag(instance_index: u32) -> u32 { + return mesh[instance_index].tag; +} \ No newline at end of file diff --git a/crates/bevy_sprite/src/mesh2d/mesh2d_types.wgsl b/crates/bevy_sprite/src/mesh2d/mesh2d_types.wgsl index d5038c818d..e29264e0bf 100644 --- a/crates/bevy_sprite/src/mesh2d/mesh2d_types.wgsl +++ b/crates/bevy_sprite/src/mesh2d/mesh2d_types.wgsl @@ -13,4 +13,5 @@ struct Mesh2d { local_from_world_transpose_b: f32, // 'flags' is a bit field indicating various options. u32 is 32 bits so we have up to 32 options. flags: u32, + tag: u32, };