Skip to content
Closed
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
7 changes: 3 additions & 4 deletions crates/bevy_pbr/src/render/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use bevy_render::{
Extract,
};
use bevy_transform::{components::GlobalTransform, prelude::Transform};
use bevy_utils::FloatOrd;
use bevy_utils::{
tracing::{error, warn},
HashMap,
Expand Down Expand Up @@ -1653,7 +1652,7 @@ pub struct Shadow {
}

impl PhaseItem for Shadow {
type SortKey = FloatOrd;
type SortKey = CachedRenderPipelineId;

#[inline]
fn entity(&self) -> Entity {
Expand All @@ -1662,7 +1661,7 @@ impl PhaseItem for Shadow {

#[inline]
fn sort_key(&self) -> Self::SortKey {
FloatOrd(self.distance)
self.pipeline
}

#[inline]
Expand All @@ -1672,7 +1671,7 @@ impl PhaseItem for Shadow {

#[inline]
fn sort(items: &mut [Self]) {
radsort::sort_by_key(items, |item| item.distance);
items.sort_by_key(|item| item.pipeline);
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_render/src/render_resource/pipeline_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum Pipeline {
type CachedPipelineId = usize;

/// Index of a cached render pipeline in a [`PipelineCache`].
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord)]
pub struct CachedRenderPipelineId(CachedPipelineId);

impl CachedRenderPipelineId {
Expand All @@ -59,7 +59,7 @@ impl CachedRenderPipelineId {
}

/// Index of a cached compute pipeline in a [`PipelineCache`].
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord)]
pub struct CachedComputePipelineId(CachedPipelineId);

impl CachedComputePipelineId {
Expand Down