webgpu: Update wgpu to 0.19 (#31995)

* Update wgpu to 32e70bc163 (0.19)

* Update expect only good

* reexpect

* remove dbg stuff

* Remove all occurrences of dx11_hub
This commit is contained in:
Samson 2024-04-26 09:04:15 +02:00 committed by GitHub
parent 81c4f2ae7a
commit 4af413cd04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 3422 additions and 9526 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use dom_struct::dom_struct;
use webgpu::WebGPUBindGroupLayout;
use webgpu::{WebGPU, WebGPUBindGroupLayout, WebGPURequest};
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUBindGroupLayoutMethods;
@ -15,15 +15,23 @@ use crate::dom::globalscope::GlobalScope;
#[dom_struct]
pub struct GPUBindGroupLayout {
reflector_: Reflector,
#[ignore_malloc_size_of = "channels are hard"]
#[no_trace]
channel: WebGPU,
label: DomRefCell<USVString>,
#[no_trace]
bind_group_layout: WebGPUBindGroupLayout,
}
impl GPUBindGroupLayout {
fn new_inherited(bind_group_layout: WebGPUBindGroupLayout, label: USVString) -> Self {
fn new_inherited(
channel: WebGPU,
bind_group_layout: WebGPUBindGroupLayout,
label: USVString,
) -> Self {
Self {
reflector_: Reflector::new(),
channel,
label: DomRefCell::new(label),
bind_group_layout,
}
@ -31,11 +39,16 @@ impl GPUBindGroupLayout {
pub fn new(
global: &GlobalScope,
channel: WebGPU,
bind_group_layout: WebGPUBindGroupLayout,
label: USVString,
) -> DomRoot<Self> {
reflect_dom_object(
Box::new(GPUBindGroupLayout::new_inherited(bind_group_layout, label)),
Box::new(GPUBindGroupLayout::new_inherited(
channel,
bind_group_layout,
label,
)),
global,
)
}
@ -47,6 +60,20 @@ impl GPUBindGroupLayout {
}
}
impl Drop for GPUBindGroupLayout {
fn drop(&mut self) {
if let Err(e) = self.channel.0.send((
None,
WebGPURequest::DropBindGroupLayout(self.bind_group_layout.0),
)) {
warn!(
"Failed to send WebGPURequest::DropBindGroupLayout({:?}) ({})",
self.bind_group_layout.0, e
);
};
}
}
impl GPUBindGroupLayoutMethods for GPUBindGroupLayout {
/// <https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label>
fn Label(&self) -> USVString {