aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/identityhub.rs
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-07-22 17:52:49 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-07-24 12:45:23 +0530
commitaff22db33ff237e0fd677671851e3919007f20ef (patch)
treeb3073acf157f99a004c53d33d7da3d839e5accd1 /components/script/dom/identityhub.rs
parent75abccb16bc19eb375ce73f26a0234e3d2ecbb9b (diff)
downloadservo-aff22db33ff237e0fd677671851e3919007f20ef.tar.gz
servo-aff22db33ff237e0fd677671851e3919007f20ef.zip
Implement GPURenderBundleEncoder and GPURenderBundle
Diffstat (limited to 'components/script/dom/identityhub.rs')
-rw-r--r--components/script/dom/identityhub.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/components/script/dom/identityhub.rs b/components/script/dom/identityhub.rs
index 3862702561e..515e9f7e1b1 100644
--- a/components/script/dom/identityhub.rs
+++ b/components/script/dom/identityhub.rs
@@ -7,8 +7,8 @@ use webgpu::wgpu::{
hub::IdentityManager,
id::{
AdapterId, BindGroupId, BindGroupLayoutId, BufferId, CommandEncoderId, ComputePipelineId,
- DeviceId, PipelineLayoutId, RenderPipelineId, SamplerId, ShaderModuleId, TextureId,
- TextureViewId,
+ DeviceId, PipelineLayoutId, RenderBundleId, RenderPipelineId, SamplerId, ShaderModuleId,
+ TextureId, TextureViewId,
},
};
use webgpu::wgt::Backend;
@@ -28,6 +28,7 @@ pub struct IdentityHub {
texture_views: IdentityManager,
samplers: IdentityManager,
render_pipelines: IdentityManager,
+ render_bundles: IdentityManager,
}
impl IdentityHub {
@@ -46,6 +47,7 @@ impl IdentityHub {
texture_views: IdentityManager::default(),
samplers: IdentityManager::default(),
render_pipelines: IdentityManager::default(),
+ render_bundles: IdentityManager::default(),
}
}
}
@@ -215,4 +217,12 @@ impl Identities {
pub fn kill_texture_view_id(&mut self, id: TextureViewId) {
self.select(id.backend()).texture_views.free(id);
}
+
+ pub fn create_render_bundle_id(&mut self, backend: Backend) -> RenderBundleId {
+ self.select(backend).render_bundles.alloc(backend)
+ }
+
+ pub fn kill_render_bundle_id(&mut self, id: RenderBundleId) {
+ self.select(id.backend()).render_bundles.free(id);
+ }
}