Fix failed request for adapter when not available (#31002)

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2024-01-09 10:12:53 +01:00 committed by GitHub
parent dd0149d953
commit fddc4a430f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 97 additions and 90 deletions

View file

@ -2063,7 +2063,11 @@ where
};
match request {
FromScriptMsg::RequestAdapter(response_sender, options, ids) => match webgpu_chan {
None => warn!("Failed to send request adapter message, missing WebGPU channel"),
None => {
if let Err(e) = response_sender.send(None) {
return warn!("Failed to send request adapter message: {}", e);
}
},
Some(webgpu_chan) => {
let adapter_request = WebGPURequest::RequestAdapter {
sender: response_sender,