Do not prepare transmission texture if there are not transmissive items to render
This commit is contained in:
parent
1099a4243f
commit
6742c5dc66
@ -531,17 +531,22 @@ pub fn prepare_core_3d_transmission_textures(
|
||||
mut texture_cache: ResMut<TextureCache>,
|
||||
render_device: Res<RenderDevice>,
|
||||
views_3d: Query<
|
||||
(Entity, &ExtractedCamera, &Camera3d, &ExtractedView),
|
||||
(
|
||||
Entity,
|
||||
&ExtractedCamera,
|
||||
&Camera3d,
|
||||
&ExtractedView,
|
||||
&RenderPhase<Transmissive3d>,
|
||||
),
|
||||
(
|
||||
With<RenderPhase<Opaque3d>>,
|
||||
With<RenderPhase<AlphaMask3d>>,
|
||||
With<RenderPhase<Transmissive3d>>,
|
||||
With<RenderPhase<Transparent3d>>,
|
||||
),
|
||||
>,
|
||||
) {
|
||||
let mut textures = HashMap::default();
|
||||
for (entity, camera, camera_3d, view) in &views_3d {
|
||||
for (entity, camera, camera_3d, view, transmissive_3d_phase) in &views_3d {
|
||||
let Some(physical_target_size) = camera.physical_target_size else {
|
||||
continue;
|
||||
};
|
||||
@ -551,6 +556,11 @@ pub fn prepare_core_3d_transmission_textures(
|
||||
continue;
|
||||
}
|
||||
|
||||
// Don't prepare a transmission texture if there are no transmissive items to render
|
||||
if transmissive_3d_phase.items.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let cached_texture = textures
|
||||
.entry(camera.target.clone())
|
||||
.or_insert_with(|| {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user