Skip to content

Commit c233d6e

Browse files
Added method to get waiting pipelines IDs from pipeline cache. (#12874)
# Objective - Add a way to easily get currently waiting pipelines IDs. ## Solution - Added a method to get waiting pipelines `CachedPipelineId`. --------- Co-authored-by: James Liu <contact@jamessliu.com>
1 parent a4ed1b8 commit c233d6e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/bevy_render/src/render_resource/pipeline_cache.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,16 @@ pub struct PipelineCache {
494494
}
495495

496496
impl PipelineCache {
497+
/// Returns an iterator over the pipelines in the pipeline cache.
497498
pub fn pipelines(&self) -> impl Iterator<Item = &CachedPipeline> {
498499
self.pipelines.iter()
499500
}
500501

502+
/// Returns a iterator of the IDs of all currently waiting pipelines.
503+
pub fn waiting_pipelines(&self) -> impl Iterator<Item = CachedPipelineId> + '_ {
504+
self.waiting_pipelines.iter().copied()
505+
}
506+
501507
/// Create a new pipeline cache associated with the given render device.
502508
pub fn new(
503509
device: RenderDevice,

0 commit comments

Comments
 (0)