mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
Update the UI texture slice pipeline to work with the retained render world changes (#15578)
# Objective Update the UI's texture slice extraction to work with the changes from the retained render world PR (#15320).
This commit is contained in:
parent
54006b107b
commit
f53af2846c
1 changed files with 8 additions and 2 deletions
|
@ -18,6 +18,7 @@ use bevy_render::{
|
||||||
renderer::{RenderDevice, RenderQueue},
|
renderer::{RenderDevice, RenderQueue},
|
||||||
texture::{BevyDefault, GpuImage, Image, TRANSPARENT_IMAGE_HANDLE},
|
texture::{BevyDefault, GpuImage, Image, TRANSPARENT_IMAGE_HANDLE},
|
||||||
view::*,
|
view::*,
|
||||||
|
world_sync::{RenderEntity, TemporaryRenderEntity},
|
||||||
Extract, ExtractSchedule, Render, RenderSet,
|
Extract, ExtractSchedule, Render, RenderSet,
|
||||||
};
|
};
|
||||||
use bevy_sprite::{
|
use bevy_sprite::{
|
||||||
|
@ -258,6 +259,7 @@ pub fn extract_ui_texture_slices(
|
||||||
Option<&TextureAtlas>,
|
Option<&TextureAtlas>,
|
||||||
)>,
|
)>,
|
||||||
>,
|
>,
|
||||||
|
mapping: Extract<Query<&RenderEntity>>,
|
||||||
) {
|
) {
|
||||||
for (uinode, transform, view_visibility, clip, camera, image, image_scale_mode, atlas) in
|
for (uinode, transform, view_visibility, clip, camera, image, image_scale_mode, atlas) in
|
||||||
&slicers_query
|
&slicers_query
|
||||||
|
@ -267,6 +269,10 @@ pub fn extract_ui_texture_slices(
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let Ok(&camera_entity) = mapping.get(camera_entity) else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
|
||||||
// Skip invisible images
|
// Skip invisible images
|
||||||
if !view_visibility.get()
|
if !view_visibility.get()
|
||||||
|| image.color.is_fully_transparent()
|
|| image.color.is_fully_transparent()
|
||||||
|
@ -291,7 +297,7 @@ pub fn extract_ui_texture_slices(
|
||||||
};
|
};
|
||||||
|
|
||||||
extracted_ui_slicers.slices.insert(
|
extracted_ui_slicers.slices.insert(
|
||||||
commands.spawn_empty().id(),
|
commands.spawn(TemporaryRenderEntity).id(),
|
||||||
ExtractedUiTextureSlice {
|
ExtractedUiTextureSlice {
|
||||||
stack_index: uinode.stack_index,
|
stack_index: uinode.stack_index,
|
||||||
transform: transform.compute_matrix(),
|
transform: transform.compute_matrix(),
|
||||||
|
@ -302,7 +308,7 @@ pub fn extract_ui_texture_slices(
|
||||||
},
|
},
|
||||||
clip: clip.map(|clip| clip.clip),
|
clip: clip.map(|clip| clip.clip),
|
||||||
image: image.texture.id(),
|
image: image.texture.id(),
|
||||||
camera_entity,
|
camera_entity: camera_entity.id(),
|
||||||
image_scale_mode: image_scale_mode.clone(),
|
image_scale_mode: image_scale_mode.clone(),
|
||||||
atlas_rect,
|
atlas_rect,
|
||||||
flip_x: image.flip_x,
|
flip_x: image.flip_x,
|
||||||
|
|
Loading…
Add table
Reference in a new issue