diff options
author | Kunal Mohan <kunalmohan99@gmail.com> | 2020-05-29 11:15:31 +0530 |
---|---|---|
committer | Kunal Mohan <kunalmohan99@gmail.com> | 2020-05-30 11:38:32 +0530 |
commit | 130de8b8e645867c5c834655d8b94defea599681 (patch) | |
tree | a424f9a22a78ebd232866e49f7982947ffce5758 /components/script/dom/identityhub.rs | |
parent | f014f15d4eaeb52e38faee15dc9a4d0f700d1d7c (diff) | |
download | servo-130de8b8e645867c5c834655d8b94defea599681.tar.gz servo-130de8b8e645867c5c834655d8b94defea599681.zip |
Implement GPURenderPipeline
Add webidl for GPURenderPipeline and implement GPUDevice.createRenderPipeline()
Diffstat (limited to 'components/script/dom/identityhub.rs')
-rw-r--r-- | components/script/dom/identityhub.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/components/script/dom/identityhub.rs b/components/script/dom/identityhub.rs index 8ba21e36969..2e7a8cc8a96 100644 --- a/components/script/dom/identityhub.rs +++ b/components/script/dom/identityhub.rs @@ -7,7 +7,7 @@ use webgpu::wgpu::{ hub::IdentityManager, id::{ AdapterId, BindGroupId, BindGroupLayoutId, BufferId, CommandEncoderId, ComputePipelineId, - DeviceId, PipelineLayoutId, SamplerId, ShaderModuleId, + DeviceId, PipelineLayoutId, RenderPipelineId, SamplerId, ShaderModuleId, }, }; use webgpu::wgt::Backend; @@ -24,6 +24,7 @@ pub struct IdentityHub { shader_modules: IdentityManager, command_encoders: IdentityManager, samplers: IdentityManager, + render_pipelines: IdentityManager, } impl IdentityHub { @@ -39,6 +40,7 @@ impl IdentityHub { shader_modules: IdentityManager::default(), command_encoders: IdentityManager::default(), samplers: IdentityManager::default(), + render_pipelines: IdentityManager::default(), } } } @@ -184,4 +186,12 @@ impl Identities { pub fn kill_sampler_id(&mut self, id: SamplerId) { self.select(id.backend()).samplers.free(id); } + + pub fn create_render_pipeline_id(&mut self, backend: Backend) -> RenderPipelineId { + self.select(backend).render_pipelines.alloc(backend) + } + + pub fn kill_render_pipeline_id(&mut self, id: RenderPipelineId) { + self.select(id.backend()).render_pipelines.free(id); + } } |