mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
webgpu: leverage routed_promise in calls returning promises (#35859)
Using the RoutedPromiseListener let us define a different response type for each promise. This removes unreachable branches that used to exist when they all shared the same WebGPUResponse. Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
4814cbdb1f
commit
1c9f486f88
15 changed files with 221 additions and 263 deletions
|
@ -5,7 +5,10 @@
|
|||
use dom_struct::dom_struct;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use webgpu::wgc::pipeline::ComputePipelineDescriptor;
|
||||
use webgpu::{WebGPU, WebGPUBindGroupLayout, WebGPUComputePipeline, WebGPURequest, WebGPUResponse};
|
||||
use webgpu::{
|
||||
WebGPU, WebGPUBindGroupLayout, WebGPUComputePipeline, WebGPUComputePipelineResponse,
|
||||
WebGPURequest,
|
||||
};
|
||||
|
||||
use crate::conversions::Convert;
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
|
@ -76,7 +79,7 @@ impl GPUComputePipeline {
|
|||
pub(crate) fn create(
|
||||
device: &GPUDevice,
|
||||
descriptor: &GPUComputePipelineDescriptor,
|
||||
async_sender: Option<IpcSender<WebGPUResponse>>,
|
||||
async_sender: Option<IpcSender<WebGPUComputePipelineResponse>>,
|
||||
) -> WebGPUComputePipeline {
|
||||
let compute_pipeline_id = device.global().wgpu_id_hub().create_compute_pipeline_id();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue