mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
webgpu: Add the dedicated WebGPU task source (#39020)
According to the WebGPU specification there are the dedicated task source which is used to queue a global task for a GPUDevice on content timeline. https://gpuweb.github.io/gpuweb/#-webgpu-task-source Tasks on content timeline: - to fire "uncaptureevent" event - to resolve GPUDevice.lost promise Also fixed the "isTrusted" attribute status (false -> true) of the "uncaptureevent" event by using non JS version of event dispatching. Testing: No changes in WebGPU CTS expectations - webgpu:api,operation,uncapturederror:* - webgpu:api,operation,device,lost:* - webgpu:api,validation,state,device_lost,destroy:* Signed-off-by: Andrei Volykhin <volykhin.andrei@huawei.com> Co-authored-by: Andrei Volykhin <volykhin.andrei@huawei.com>
This commit is contained in:
parent
aab9beb3de
commit
d253fe70f1
7 changed files with 51 additions and 30 deletions
|
@ -3191,7 +3191,6 @@ impl GlobalScope {
|
|||
device: WebGPUDevice,
|
||||
reason: DeviceLostReason,
|
||||
msg: String,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
let reason = match reason {
|
||||
DeviceLostReason::Unknown => GPUDeviceLostReason::Unknown,
|
||||
|
@ -3205,7 +3204,7 @@ impl GlobalScope {
|
|||
.expect("GPUDevice should still be in devices hashmap")
|
||||
.root()
|
||||
{
|
||||
device.lose(reason, msg, can_gc);
|
||||
device.lose(reason, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3214,7 +3213,6 @@ impl GlobalScope {
|
|||
&self,
|
||||
device: WebGPUDevice,
|
||||
error: webgpu_traits::Error,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
if let Some(gpu_device) = self
|
||||
.gpu_devices
|
||||
|
@ -3222,7 +3220,7 @@ impl GlobalScope {
|
|||
.get(&device)
|
||||
.and_then(|device| device.root())
|
||||
{
|
||||
gpu_device.fire_uncaptured_error(error, can_gc);
|
||||
gpu_device.fire_uncaptured_error(error);
|
||||
} else {
|
||||
warn!("Recived error for lost GPUDevice!")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue