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;
3030mod platform_types;
3131pub use platform_types:: * ;
3232
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_ptr ( _: * mut u8 ) -> Self ;
37+ }
38+
3339pub trait Handle : Sized {
3440 const TYPE : ObjectType ;
3541 fn as_raw ( self ) -> u64 ;
Original file line number Diff line number Diff line change @@ -141,6 +141,11 @@ macro_rules! define_handle {
141141 Self ( x as _)
142142 }
143143 }
144+ impl $crate:: vk:: DispatchableHandle for $name {
145+ fn from_raw_ptr( x: * mut u8 ) -> Self {
146+ Self ( x)
147+ }
148+ }
144149 unsafe impl Send for $name { }
145150 unsafe impl Sync for $name { }
146151 impl $name {
You can’t perform that action at this time.
0 commit comments