separate Queue&Device Id (#32966)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Samson 2024-08-08 09:53:17 +02:00 committed by GitHub
parent a5df51ea56
commit f989d3776e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 54 additions and 32 deletions

View file

@ -143,21 +143,3 @@ pub struct PresentationData {
image_desc: ImageDescriptor,
image_data: ImageData,
}
pub trait Transmute<U: id::Marker> {
fn transmute(self) -> id::Id<U>;
}
impl Transmute<id::markers::Queue> for id::Id<id::markers::Device> {
fn transmute(self) -> id::Id<id::markers::Queue> {
// if this is removed next one should be removed too.
self.into_queue_id()
}
}
impl Transmute<id::markers::Device> for id::Id<id::markers::Queue> {
fn transmute(self) -> id::Id<id::markers::Device> {
// SAFETY: This is safe because queue_id = device_id in wgpu
unsafe { id::Id::from_raw(self.into_raw()) }
}
}