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

@ -21,10 +21,14 @@ pub struct GPURenderPipeline {
}
impl GPURenderPipeline {
fn new_inherited(render_pipeline: WebGPURenderPipeline, device: WebGPUDevice) -> Self {
fn new_inherited(
render_pipeline: WebGPURenderPipeline,
device: WebGPUDevice,
label: Option<USVString>,
) -> Self {
Self {
reflector_: Reflector::new(),
label: DomRefCell::new(None),
label: DomRefCell::new(label),
render_pipeline,
device,
}
@ -34,9 +38,14 @@ impl GPURenderPipeline {
global: &GlobalScope,
render_pipeline: WebGPURenderPipeline,
device: WebGPUDevice,
label: Option<USVString>,
) -> DomRoot<Self> {
reflect_dom_object(
Box::new(GPURenderPipeline::new_inherited(render_pipeline, device)),
Box::new(GPURenderPipeline::new_inherited(
render_pipeline,
device,
label,
)),
global,
)
}