diff options
author | Kunal Mohan <kunalmohan99@gmail.com> | 2020-08-19 16:44:26 +0530 |
---|---|---|
committer | Kunal Mohan <kunalmohan99@gmail.com> | 2020-08-19 16:44:26 +0530 |
commit | f082a507da2a09d579021f8b2f0930afdec74c24 (patch) | |
tree | f1c85fce90094949e38099218389cec164ce92c0 /components/script/dom/gpupipelinelayout.rs | |
parent | 8c576bb02b6424d6a7d0d02551face0b461c0e0e (diff) | |
download | servo-f082a507da2a09d579021f8b2f0930afdec74c24.tar.gz servo-f082a507da2a09d579021f8b2f0930afdec74c24.zip |
Implement GPUPipelineBase for implicit pipeline layouts
Diffstat (limited to 'components/script/dom/gpupipelinelayout.rs')
-rw-r--r-- | components/script/dom/gpupipelinelayout.rs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/components/script/dom/gpupipelinelayout.rs b/components/script/dom/gpupipelinelayout.rs index 7547adce843..563d0ca9220 100644 --- a/components/script/dom/gpupipelinelayout.rs +++ b/components/script/dom/gpupipelinelayout.rs @@ -9,21 +9,27 @@ use crate::dom::bindings::root::DomRoot; use crate::dom::bindings::str::USVString; use crate::dom::globalscope::GlobalScope; use dom_struct::dom_struct; -use webgpu::WebGPUPipelineLayout; +use webgpu::{WebGPUBindGroupLayout, WebGPUPipelineLayout}; #[dom_struct] pub struct GPUPipelineLayout { reflector_: Reflector, label: DomRefCell<Option<USVString>>, pipeline_layout: WebGPUPipelineLayout, + bind_group_layouts: Vec<WebGPUBindGroupLayout>, } impl GPUPipelineLayout { - fn new_inherited(pipeline_layout: WebGPUPipelineLayout, label: Option<USVString>) -> Self { + fn new_inherited( + pipeline_layout: WebGPUPipelineLayout, + label: Option<USVString>, + bgls: Vec<WebGPUBindGroupLayout>, + ) -> Self { Self { reflector_: Reflector::new(), label: DomRefCell::new(label), pipeline_layout, + bind_group_layouts: bgls, } } @@ -31,9 +37,14 @@ impl GPUPipelineLayout { global: &GlobalScope, pipeline_layout: WebGPUPipelineLayout, label: Option<USVString>, + bgls: Vec<WebGPUBindGroupLayout>, ) -> DomRoot<Self> { reflect_dom_object( - Box::new(GPUPipelineLayout::new_inherited(pipeline_layout, label)), + Box::new(GPUPipelineLayout::new_inherited( + pipeline_layout, + label, + bgls, + )), global, ) } @@ -43,6 +54,10 @@ impl GPUPipelineLayout { pub fn id(&self) -> WebGPUPipelineLayout { self.pipeline_layout } + + pub fn bind_group_layouts(&self) -> Vec<WebGPUBindGroupLayout> { + self.bind_group_layouts.clone() + } } impl GPUPipelineLayoutMethods for GPUPipelineLayout { |