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>
This commit is contained in:
Remi Godin 2024-04-04 20:46:15 -07:00 committed by GitHub
parent a4ed1b88b8
commit c233d6e0d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -494,10 +494,16 @@ pub struct PipelineCache {
}
impl PipelineCache {
/// Returns an iterator over the pipelines in the pipeline cache.
pub fn pipelines(&self) -> impl Iterator<Item = &CachedPipeline> {
self.pipelines.iter()
}
/// Returns a iterator of the IDs of all currently waiting pipelines.
pub fn waiting_pipelines(&self) -> impl Iterator<Item = CachedPipelineId> + '_ {
self.waiting_pipelines.iter().copied()
}
/// Create a new pipeline cache associated with the given render device.
pub fn new(
device: RenderDevice,