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::{WebGPUBindGroup, WebGPUDevice};
use webgpu::{WebGPU, WebGPUBindGroup, WebGPUDevice, WebGPURequest};
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUBindGroupMethods;
@ -16,6 +16,9 @@ use crate::dom::gpubindgrouplayout::GPUBindGroupLayout;
#[dom_struct]
pub struct GPUBindGroup {
reflector_: Reflector,
#[ignore_malloc_size_of = "channels are hard"]
#[no_trace]
channel: WebGPU,
label: DomRefCell<USVString>,
#[no_trace]
bind_group: WebGPUBindGroup,
@ -26,6 +29,7 @@ pub struct GPUBindGroup {
impl GPUBindGroup {
fn new_inherited(
channel: WebGPU,
bind_group: WebGPUBindGroup,
device: WebGPUDevice,
layout: &GPUBindGroupLayout,
@ -33,6 +37,7 @@ impl GPUBindGroup {
) -> Self {
Self {
reflector_: Reflector::new(),
channel,
label: DomRefCell::new(label),
bind_group,
device,
@ -42,6 +47,7 @@ impl GPUBindGroup {
pub fn new(
global: &GlobalScope,
channel: WebGPU,
bind_group: WebGPUBindGroup,
device: WebGPUDevice,
layout: &GPUBindGroupLayout,
@ -49,7 +55,7 @@ impl GPUBindGroup {
) -> DomRoot<Self> {
reflect_dom_object(
Box::new(GPUBindGroup::new_inherited(
bind_group, device, layout, label,
channel, bind_group, device, layout, label,
)),
global,
)
@ -62,6 +68,21 @@ impl GPUBindGroup {
}
}
impl Drop for GPUBindGroup {
fn drop(&mut self) {
if let Err(e) = self
.channel
.0
.send((None, WebGPURequest::DropBindGroup(self.bind_group.0)))
{
warn!(
"Failed to send WebGPURequest::DropBindGroup({:?}) ({})",
self.bind_group.0, e
);
};
}
}
impl GPUBindGroupMethods for GPUBindGroup {
/// <https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label>
fn Label(&self) -> USVString {