Implement GPURenderBundleEncoder and GPURenderBundle

This commit is contained in:
Kunal Mohan 2020-07-22 17:52:49 +05:30
parent 75abccb16b
commit aff22db33f
32 changed files with 676 additions and 115 deletions

View file

@ -19,17 +19,21 @@ pub struct GPUBindGroupLayout {
}
impl GPUBindGroupLayout {
fn new_inherited(bind_group_layout: WebGPUBindGroupLayout) -> Self {
fn new_inherited(bind_group_layout: WebGPUBindGroupLayout, label: Option<USVString>) -> Self {
Self {
reflector_: Reflector::new(),
label: DomRefCell::new(None),
label: DomRefCell::new(label),
bind_group_layout,
}
}
pub fn new(global: &GlobalScope, bind_group_layout: WebGPUBindGroupLayout) -> DomRoot<Self> {
pub fn new(
global: &GlobalScope,
bind_group_layout: WebGPUBindGroupLayout,
label: Option<USVString>,
) -> DomRoot<Self> {
reflect_dom_object(
Box::new(GPUBindGroupLayout::new_inherited(bind_group_layout)),
Box::new(GPUBindGroupLayout::new_inherited(bind_group_layout, label)),
global,
)
}