From 86f8269f8eda3cd255bbccfb27b332520965d3a2 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Wed, 26 Aug 2026 07:16:23 +0200 Subject: [PATCH] [remote] Remove pipeline cache Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- wgpu-core-remote/src/global/device.rs | 40 --------------------------- wgpu-core-remote/src/hub.rs | 4 +-- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/wgpu-core-remote/src/global/device.rs b/wgpu-core-remote/src/global/device.rs index 2753a6627..f71344979 100644 --- a/wgpu-core-remote/src/global/device.rs +++ b/wgpu-core-remote/src/global/device.rs @@ -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, - ) { - 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> { - 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); diff --git a/wgpu-core-remote/src/hub.rs b/wgpu-core-remote/src/hub.rs index 8536423c7..b2405666b 100644 --- a/wgpu-core-remote/src/hub.rs +++ b/wgpu-core-remote/src/hub.rs @@ -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>, pub(crate) render_pipelines: Registry>, pub(crate) compute_pipelines: Registry>, - pub(crate) pipeline_caches: Registry>, pub(crate) query_sets: Registry>, pub(crate) buffers: Registry>, pub(crate) textures: Registry>, @@ -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(),