Make WebGPU resource creation fully async

Remove some garbage code in adapter id checks
Prevent panic during shutdown if using WebGPU
This commit is contained in:
Kunal Mohan 2020-05-26 12:30:28 +05:30
parent a3446579ec
commit f4d0183568
6 changed files with 65 additions and 165 deletions

View file

@ -179,10 +179,16 @@ impl GPUBufferMethods for GPUBuffer {
},
_ => {},
};
self.channel
if let Err(e) = self
.channel
.0
.send(WebGPURequest::DestroyBuffer(self.buffer.0))
.unwrap();
{
warn!(
"Failed to send WebGPURequest::DestroyBuffer({:?}) ({})",
self.buffer.0, e
);
};
*self.state.borrow_mut() = GPUBufferState::Destroyed;
}