1 // Copyright (c) 2021 The vulkano developers 2 // Licensed under the Apache License, Version 2.0 3 // <LICENSE-APACHE or 4 // https://www.apache.org/licenses/LICENSE-2.0> or the MIT 5 // license <LICENSE-MIT or https://opensource.org/licenses/MIT>, 6 // at your option. All files in the project carrying such 7 // notice may not be copied, modified, or distributed except 8 // according to those terms. 9 10 macro_rules! fns { 11 ($struct_name:ident, { $($member:ident => $fn_struct:ident,)+ }) => { 12 pub struct $struct_name { 13 $( 14 pub $member: ash::vk::$fn_struct, 15 )+ 16 } 17 18 impl $struct_name { 19 pub fn load<F>(mut load_fn: F) -> $struct_name 20 where F: FnMut(&std::ffi::CStr) -> *const std::ffi::c_void 21 { 22 $struct_name { 23 $( 24 $member: ash::vk::$fn_struct::load(&mut load_fn), 25 )+ 26 } 27 } 28 } 29 }; 30 } 31 32 pub use crate::autogen::{DeviceFunctions, EntryFunctions, InstanceFunctions}; 33 pub(crate) use fns; 34