]> git.nega.tv - josh/narcissus/commitdiff
vulkan-sys: Use a simpler alignment check for SPV
authorJoshua Simmons <josh@nega.tv>
Sat, 29 Jul 2023 13:12:41 +0000 (15:12 +0200)
committerJoshua Simmons <josh@nega.tv>
Sat, 29 Jul 2023 13:12:41 +0000 (15:12 +0200)
libs/ffi/vulkan-sys/examples/triangle.rs

index 892a8db439ee641a8a7ff737217d64133822ee16..c58313de5f0b80ca4dbb6c346aeb792e59c1b691 100644 (file)
@@ -227,7 +227,7 @@ pub fn main() {
     };
 
     let create_shader_module = |code: &[u8]| {
-        debug_assert!((code.as_ptr() as usize) & ((1 << 3) - 1) == 0);
+        debug_assert!(code.as_ptr().align_offset(4) == 0);
         let create_info = vk::ShaderModuleCreateInfo {
             code: code.into(),
             ..default()