Commit 9134359 1 parent d783af0 commit 9134359 Copy full SHA for 9134359
File tree 3 files changed +19
-0
lines changed
3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
### Added
11
11
12
+ - Added ` Handle::is_null() ` to allow checking if a handle is a ` NULL ` value (#694 )
12
13
- Update Vulkan-Headers to 1.3.246 (#697 , #723 )
13
14
- Added ` VK_KHR_performance_query ` device extension (#726 )
14
15
- Added ` VK_EXT_shader_object ` device extension (#732 )
Original file line number Diff line number Diff line change @@ -49,4 +49,16 @@ pub trait Handle {
49
49
const TYPE : ObjectType ;
50
50
fn as_raw ( self ) -> u64 ;
51
51
fn from_raw ( _: u64 ) -> Self ;
52
+
53
+ /// Returns whether the handle is a `NULL` value.
54
+ ///
55
+ /// # Example
56
+ ///
57
+ /// ```
58
+ /// # use ash::vk::{Handle, Instance};
59
+ ///
60
+ /// let instance = Instance::null();
61
+ /// assert!(instance.is_null());
62
+ /// ```
63
+ fn is_null ( self ) -> bool ;
52
64
}
Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ macro_rules! handle_nondispatchable {
99
99
fn from_raw( x: u64 ) -> Self {
100
100
Self ( x)
101
101
}
102
+ fn is_null( self ) -> bool {
103
+ self . 0 == 0
104
+ }
102
105
}
103
106
impl $name {
104
107
pub const fn null( ) -> Self {
@@ -140,6 +143,9 @@ macro_rules! define_handle {
140
143
fn from_raw( x: u64 ) -> Self {
141
144
Self ( x as _)
142
145
}
146
+ fn is_null( self ) -> bool {
147
+ self . 0 . is_null( )
148
+ }
143
149
}
144
150
unsafe impl Send for $name { }
145
151
unsafe impl Sync for $name { }
You can’t perform that action at this time.
0 commit comments