mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
[remote] Remove pipeline cache
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
b67114f75a
commit
86f8269f8e
2 files changed
+1
-43
No files matched your search
@@ -1000,40 +1000,6 @@ impl Global {
|
||||
let _pipeline = hub.compute_pipelines.remove(compute_pipeline_id);
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
/// The `data` argument of `desc` must have been returned by
|
||||
/// [Self::pipeline_cache_get_data] for the same adapter
|
||||
pub unsafe fn device_create_pipeline_cache(
|
||||
&self,
|
||||
device_id: DeviceId,
|
||||
desc: &pipeline::PipelineCacheDescriptor<'_>,
|
||||
id_in: id::PipelineCacheId,
|
||||
) -> (
|
||||
id::PipelineCacheId,
|
||||
Option<pipeline::CreatePipelineCacheError>,
|
||||
) {
|
||||
let mut hub = self.hub.borrow_mut();
|
||||
let Hub {
|
||||
pipeline_caches,
|
||||
devices,
|
||||
..
|
||||
} = &mut *hub;
|
||||
|
||||
let device = devices.get(device_id);
|
||||
|
||||
let (cache, error) = unsafe { device.create_pipeline_cache(desc) };
|
||||
|
||||
let id = pipeline_caches.assign(id_in, cache);
|
||||
|
||||
(id, error)
|
||||
}
|
||||
|
||||
pub fn pipeline_cache_drop(&self, pipeline_cache_id: id::PipelineCacheId) {
|
||||
let mut hub = self.hub.borrow_mut();
|
||||
|
||||
let _cache = hub.pipeline_caches.remove(pipeline_cache_id);
|
||||
}
|
||||
|
||||
/// Check `device_id` for freeable resources and completed buffer mappings.
|
||||
///
|
||||
/// Return `queue_empty` indicating whether there are more queue submissions still in flight.
|
||||
@@ -1082,12 +1048,6 @@ impl Global {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pipeline_cache_get_data(&self, id: id::PipelineCacheId) -> Option<Vec<u8>> {
|
||||
let hub = self.hub.borrow();
|
||||
|
||||
hub.pipeline_caches.get(id).get_data()
|
||||
}
|
||||
|
||||
pub fn device_drop(&self, device_id: DeviceId) {
|
||||
let mut hub = self.hub.borrow_mut();
|
||||
hub.devices.remove(device_id);
|
||||
|
||||
@@ -93,7 +93,7 @@ use wgpu_core::{
|
||||
},
|
||||
device::{queue::Queue, Device},
|
||||
instance::Adapter,
|
||||
pipeline::{ComputePipeline, PipelineCache, RenderPipeline, ShaderModule},
|
||||
pipeline::{ComputePipeline, RenderPipeline, ShaderModule},
|
||||
resource::{Buffer, ExternalTexture, QuerySet, Sampler, Texture, TextureView},
|
||||
};
|
||||
|
||||
@@ -129,7 +129,6 @@ pub struct Hub {
|
||||
pub(crate) render_bundles: Registry<Arc<RenderBundle>>,
|
||||
pub(crate) render_pipelines: Registry<Arc<RenderPipeline>>,
|
||||
pub(crate) compute_pipelines: Registry<Arc<ComputePipeline>>,
|
||||
pub(crate) pipeline_caches: Registry<Arc<PipelineCache>>,
|
||||
pub(crate) query_sets: Registry<Arc<QuerySet>>,
|
||||
pub(crate) buffers: Registry<Arc<Buffer>>,
|
||||
pub(crate) textures: Registry<Arc<Texture>>,
|
||||
@@ -156,7 +155,6 @@ impl Hub {
|
||||
render_bundles: Registry::new(),
|
||||
render_pipelines: Registry::new(),
|
||||
compute_pipelines: Registry::new(),
|
||||
pipeline_caches: Registry::new(),
|
||||
query_sets: Registry::new(),
|
||||
buffers: Registry::new(),
|
||||
textures: Registry::new(),
|
||||
|
||||
Reference in new issue
Block a user