mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Ensure GPUDevice cleanup in GlobalScope
This commit is contained in:
parent
37d606621d
commit
785497af63
4 changed files with 52 additions and 3 deletions
|
@ -177,6 +177,7 @@ pub enum WebGPURequest {
|
|||
},
|
||||
DestroyTexture(id::TextureId),
|
||||
Exit(IpcSender<()>),
|
||||
FreeDevice(id::DeviceId),
|
||||
RequestAdapter {
|
||||
sender: IpcSender<WebGPUResponseResult>,
|
||||
options: RequestAdapterOptions,
|
||||
|
@ -344,6 +345,7 @@ impl<'a> WGPU<'a> {
|
|||
) -> Self {
|
||||
let factory = IdentityRecyclerFactory {
|
||||
sender: script_sender.clone(),
|
||||
self_sender: sender.clone(),
|
||||
};
|
||||
WGPU {
|
||||
receiver,
|
||||
|
@ -774,6 +776,16 @@ impl<'a> WGPU<'a> {
|
|||
}
|
||||
return;
|
||||
},
|
||||
WebGPURequest::FreeDevice(device_id) => {
|
||||
let device = WebGPUDevice(device_id);
|
||||
let pipeline_id = self.devices.remove(&device).unwrap();
|
||||
if let Err(e) = self.script_sender.send(WebGPUMsg::CleanDevice {
|
||||
device,
|
||||
pipeline_id,
|
||||
}) {
|
||||
warn!("Unable to send CleanDevice({:?}) ({:?})", device_id, e);
|
||||
}
|
||||
},
|
||||
WebGPURequest::RequestAdapter {
|
||||
sender,
|
||||
options,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue