mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
separate Queue&Device Id (#32966)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
a5df51ea56
commit
f989d3776e
7 changed files with 54 additions and 32 deletions
|
@ -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()) }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue