Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove camera from UiBatch #17663

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions crates/bevy_ui/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,6 @@ pub(crate) const QUAD_INDICES: [usize; 6] = [0, 2, 3, 0, 1, 2];
pub struct UiBatch {
pub range: Range<u32>,
pub image: AssetId<Image>,
pub camera: Entity,
}

/// The values here should match the values for the constants in `ui.wgsl`
Expand Down Expand Up @@ -1083,8 +1082,6 @@ pub fn prepare_uinodes(
|| (batch_image_handle != AssetId::default()
&& extracted_uinode.image != AssetId::default()
&& batch_image_handle != extracted_uinode.image)
|| existing_batch.as_ref().map(|(_, b)| b.camera)
!= Some(extracted_uinode.extracted_camera_entity)
{
if let Some(gpu_image) = gpu_images.get(extracted_uinode.image) {
batch_item_index = item_index;
Expand All @@ -1093,7 +1090,6 @@ pub fn prepare_uinodes(
let new_batch = UiBatch {
range: vertices_index..vertices_index,
image: extracted_uinode.image,
camera: extracted_uinode.extracted_camera_entity,
};

batches.push((item.entity(), new_batch));
Expand Down
4 changes: 0 additions & 4 deletions crates/bevy_ui/src/render/ui_texture_slice_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ struct UiTextureSliceVertex {
pub struct UiTextureSlicerBatch {
pub range: Range<u32>,
pub image: AssetId<Image>,
pub camera: Entity,
}

#[derive(Resource)]
Expand Down Expand Up @@ -446,8 +445,6 @@ pub fn prepare_ui_slices(
|| (batch_image_handle != AssetId::default()
&& texture_slices.image != AssetId::default()
&& batch_image_handle != texture_slices.image)
|| existing_batch.as_ref().map(|(_, b)| b.camera)
!= Some(texture_slices.extracted_camera_entity)
{
if let Some(gpu_image) = gpu_images.get(texture_slices.image) {
batch_item_index = item_index;
Expand All @@ -457,7 +454,6 @@ pub fn prepare_ui_slices(
let new_batch = UiTextureSlicerBatch {
range: vertices_index..vertices_index,
image: texture_slices.image,
camera: texture_slices.extracted_camera_entity,
};

batches.push((item.entity(), new_batch));
Expand Down