File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ pub mod native;
30
30
mod platform_types;
31
31
pub use platform_types:: * ;
32
32
33
+ pub trait DispatchableHandle : Handle {
34
+ // We choose to use a pointer type for the parameter to avoid possible integer-to-pointer cast,
35
+ // to keep the pointer provenance. See details at https://github.com/ash-rs/ash/issues/996.
36
+ fn from_raw ( _: * mut u8 ) -> Self ;
37
+ }
38
+
33
39
pub trait Handle : Sized {
34
40
const TYPE : ObjectType ;
35
41
fn as_raw ( self ) -> u64 ;
Original file line number Diff line number Diff line change @@ -141,6 +141,11 @@ macro_rules! define_handle {
141
141
Self ( x as _)
142
142
}
143
143
}
144
+ impl $crate:: vk:: DispatchableHandle for $name {
145
+ fn from_raw( x: * mut u8 ) -> Self {
146
+ Self ( x)
147
+ }
148
+ }
144
149
unsafe impl Send for $name { }
145
150
unsafe impl Sync for $name { }
146
151
impl $name {
You can’t perform that action at this time.
0 commit comments