mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
webgpu: Update wgpu to 22.0 (#32827)
* Update wgpu to c0e7c1ef94
This is few commits ahead of wgpu 22.0
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Make it compile
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Move usage checking to device timeline as per spec
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Add logging (trace) of WEBGPU messages
This is very useful when debugging
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* update wgpu again
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* set good
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* skip `webgpu:api,operation,memory_sync,texture,same_subresource` for flakyness
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* rm r.json
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
450aebc839
commit
ad74bfc4ea
9 changed files with 80 additions and 314 deletions
|
@ -7,6 +7,7 @@ use std::rc::Rc;
|
|||
|
||||
use dom_struct::dom_struct;
|
||||
use js::jsapi::{Heap, JSObject};
|
||||
use webgpu::wgt::MemoryHints;
|
||||
use webgpu::{wgt, WebGPU, WebGPUAdapter, WebGPURequest, WebGPUResponse};
|
||||
|
||||
use super::gpusupportedfeatures::GPUSupportedFeatures;
|
||||
|
@ -124,6 +125,7 @@ impl GPUAdapterMethods for GPUAdapter {
|
|||
required_features: features,
|
||||
required_limits: wgt::Limits::default(),
|
||||
label: None,
|
||||
memory_hints: MemoryHints::MemoryUsage,
|
||||
};
|
||||
if let Some(limits) = &descriptor.requiredLimits {
|
||||
for (limit, value) in (*limits).iter() {
|
||||
|
|
|
@ -256,24 +256,17 @@ impl GPUDeviceMethods for GPUDevice {
|
|||
|
||||
/// <https://gpuweb.github.io/gpuweb/#dom-gpudevice-createbuffer>
|
||||
fn CreateBuffer(&self, descriptor: &GPUBufferDescriptor) -> Fallible<DomRoot<GPUBuffer>> {
|
||||
let desc =
|
||||
wgt::BufferUsages::from_bits(descriptor.usage).map(|usg| wgpu_res::BufferDescriptor {
|
||||
label: convert_label(&descriptor.parent),
|
||||
size: descriptor.size as wgt::BufferAddress,
|
||||
usage: usg,
|
||||
mapped_at_creation: descriptor.mappedAtCreation,
|
||||
});
|
||||
let desc = wgpu_res::BufferDescriptor {
|
||||
label: convert_label(&descriptor.parent),
|
||||
size: descriptor.size as wgt::BufferAddress,
|
||||
usage: wgt::BufferUsages::from_bits_retain(descriptor.usage),
|
||||
mapped_at_creation: descriptor.mappedAtCreation,
|
||||
};
|
||||
let id = self
|
||||
.global()
|
||||
.wgpu_id_hub()
|
||||
.create_buffer_id(self.device.0.backend());
|
||||
|
||||
if desc.is_none() {
|
||||
self.dispatch_error(webgpu::Error::Validation(String::from(
|
||||
"Invalid GPUBufferUsage",
|
||||
)));
|
||||
}
|
||||
|
||||
self.channel
|
||||
.0
|
||||
.send(WebGPURequest::CreateBuffer {
|
||||
|
@ -581,7 +574,6 @@ impl GPUDeviceMethods for GPUDevice {
|
|||
entry_point: Some(Cow::Owned(descriptor.compute.entryPoint.to_string())),
|
||||
constants: Cow::Owned(HashMap::new()),
|
||||
zero_initialize_workgroup_memory: true,
|
||||
vertex_pulling_transform: false,
|
||||
},
|
||||
cache: None,
|
||||
};
|
||||
|
@ -772,7 +764,6 @@ impl GPUDeviceMethods for GPUDevice {
|
|||
)),
|
||||
constants: Cow::Owned(HashMap::new()),
|
||||
zero_initialize_workgroup_memory: true,
|
||||
vertex_pulling_transform: false,
|
||||
},
|
||||
buffers: Cow::Owned(
|
||||
descriptor
|
||||
|
@ -809,7 +800,6 @@ impl GPUDeviceMethods for GPUDevice {
|
|||
entry_point: Some(Cow::Owned(stage.parent.entryPoint.to_string())),
|
||||
constants: Cow::Owned(HashMap::new()),
|
||||
zero_initialize_workgroup_memory: true,
|
||||
vertex_pulling_transform: false,
|
||||
},
|
||||
targets: Cow::Owned(
|
||||
stage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue