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,11 +21,15 @@ pub struct GPUTextureView {
}
impl GPUTextureView {
fn new_inherited(texture_view: WebGPUTextureView, texture: &GPUTexture) -> GPUTextureView {
fn new_inherited(
texture_view: WebGPUTextureView,
texture: &GPUTexture,
label: Option<USVString>,
) -> GPUTextureView {
Self {
reflector_: Reflector::new(),
texture: Dom::from_ref(texture),
label: DomRefCell::new(None),
label: DomRefCell::new(label),
texture_view,
}
}
@ -34,9 +38,10 @@ impl GPUTextureView {
global: &GlobalScope,
texture_view: WebGPUTextureView,
texture: &GPUTexture,
label: Option<USVString>,
) -> DomRoot<GPUTextureView> {
reflect_dom_object(
Box::new(GPUTextureView::new_inherited(texture_view, texture)),
Box::new(GPUTextureView::new_inherited(texture_view, texture, label)),
global,
)
}