diff --git a/bindings_generator/src/main.rs b/bindings_generator/src/main.rs index 53aa91f..9f5c657 100644 --- a/bindings_generator/src/main.rs +++ b/bindings_generator/src/main.rs @@ -19,6 +19,13 @@ fn main() { .clang_arg(format!("-I{}", header_dst.display())) .clang_arg(format!("-I{}", header_compiler_dst.display())) .parse_callbacks(Box::new(callbacks::SpirvToDxilCallbacks)) + .allowlist_var("DXIL_SPIRV_MAX_VIEWPORT") + .allowlist_type("dxil_spirv_.*") + .allowlist_type("dxil_shader_model") + .allowlist_type("dxil_validator_version") + .allowlist_function("spirv_to_dxil") + .allowlist_function("spirv_to_dxil_free") + .allowlist_function("spirv_to_dxil_get_version") .rustified_enum("dxil_spirv_shader_stage") .rustified_non_exhaustive_enum("dxil_shader_model") .rustified_non_exhaustive_enum("dxil_validator_version") diff --git a/spirv-to-dxil-sys/src/bindings.rs b/spirv-to-dxil-sys/src/bindings.rs index f4445f0..c981a64 100644 --- a/spirv-to-dxil-sys/src/bindings.rs +++ b/spirv-to-dxil-sys/src/bindings.rs @@ -1,41 +1,5 @@ /* automatically generated by rust-bindgen 0.64.0 */ -pub const __bool_true_false_are_defined: u32 = 1; -pub const false_: u32 = 0; -pub const true_: u32 = 1; -pub const _VCRT_COMPILER_PREPROCESSOR: u32 = 1; -pub const _SAL_VERSION: u32 = 20; -pub const __SAL_H_VERSION: u32 = 180000000; -pub const _USE_DECLSPECS_FOR_SAL: u32 = 0; -pub const _USE_ATTRIBUTES_FOR_SAL: u32 = 0; -pub const _CRT_PACKING: u32 = 8; -pub const _HAS_EXCEPTIONS: u32 = 1; -pub const _STL_LANG: u32 = 0; -pub const _HAS_CXX17: u32 = 0; -pub const _HAS_CXX20: u32 = 0; -pub const _HAS_CXX23: u32 = 0; -pub const _HAS_NODISCARD: u32 = 0; -pub const _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE: u32 = 1; -pub const _CRT_BUILD_DESKTOP_APP: u32 = 1; -pub const _ARGMAX: u32 = 100; -pub const _CRT_INT_MAX: u32 = 2147483647; -pub const _CRT_FUNCTIONS_REQUIRED: u32 = 1; -pub const _CRT_HAS_CXX17: u32 = 0; -pub const _CRT_HAS_C11: u32 = 1; -pub const _CRT_INTERNAL_NONSTDC_NAMES: u32 = 1; -pub const __STDC_SECURE_LIB__: u32 = 200411; -pub const __GOT_SECURE_LIB__: u32 = 200411; -pub const __STDC_WANT_SECURE_LIB__: u32 = 1; -pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 254; -pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES: u32 = 0; -pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT: u32 = 0; -pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES: u32 = 1; -pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY: u32 = 0; -pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; -pub const WCHAR_MIN: u32 = 0; -pub const WCHAR_MAX: u32 = 65535; -pub const WINT_MIN: u32 = 0; -pub const WINT_MAX: u32 = 65535; pub const DXIL_SPIRV_MAX_VIEWPORT: u32 = 16; #[repr(i32)] #[non_exhaustive] @@ -66,229 +30,6 @@ pub enum dxil_validator_version { Validator1_7 = 65543, Validator1_8 = 65544, } -pub type va_list = *mut ::std::os::raw::c_char; -extern "C" { - pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...); -} -pub type __vcrt_bool = bool; -pub type wchar_t = ::std::os::raw::c_ushort; -extern "C" { - pub fn __security_init_cookie(); -} -extern "C" { - pub fn __security_check_cookie(_StackCookie: usize); -} -extern "C" { - pub fn __report_gsfailure(_StackCookie: usize) -> !; -} -extern "C" { - pub static mut __security_cookie: usize; -} -pub type __crt_bool = bool; -extern "C" { - pub fn _invalid_parameter_noinfo(); -} -extern "C" { - pub fn _invalid_parameter_noinfo_noreturn() -> !; -} -extern "C" { - pub fn _invoke_watson( - _Expression: *const wchar_t, - _FunctionName: *const wchar_t, - _FileName: *const wchar_t, - _LineNo: ::std::os::raw::c_uint, - _Reserved: usize, - ) -> !; -} -pub type errno_t = ::std::os::raw::c_int; -pub type wint_t = ::std::os::raw::c_ushort; -pub type wctype_t = ::std::os::raw::c_ushort; -pub type __time32_t = ::std::os::raw::c_long; -pub type __time64_t = ::std::os::raw::c_longlong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_locale_data_public { - pub _locale_pctype: *const ::std::os::raw::c_ushort, - pub _locale_mb_cur_max: ::std::os::raw::c_int, - pub _locale_lc_codepage: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___crt_locale_data_public() { - const UNINIT: ::std::mem::MaybeUninit<__crt_locale_data_public> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__crt_locale_data_public>(), - 16usize, - concat!("Size of: ", stringify!(__crt_locale_data_public)) - ); - assert_eq!( - ::std::mem::align_of::<__crt_locale_data_public>(), - 8usize, - concat!("Alignment of ", stringify!(__crt_locale_data_public)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._locale_pctype) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_pctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._locale_mb_cur_max) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_mb_cur_max) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._locale_lc_codepage) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_lc_codepage) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_locale_pointers { - pub locinfo: *mut __crt_locale_data, - pub mbcinfo: *mut __crt_multibyte_data, -} -#[test] -fn bindgen_test_layout___crt_locale_pointers() { - const UNINIT: ::std::mem::MaybeUninit<__crt_locale_pointers> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__crt_locale_pointers>(), - 16usize, - concat!("Size of: ", stringify!(__crt_locale_pointers)) - ); - assert_eq!( - ::std::mem::align_of::<__crt_locale_pointers>(), - 8usize, - concat!("Alignment of ", stringify!(__crt_locale_pointers)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).locinfo) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_pointers), - "::", - stringify!(locinfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mbcinfo) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_pointers), - "::", - stringify!(mbcinfo) - ) - ); -} -pub type _locale_t = *mut __crt_locale_pointers; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _Mbstatet { - pub _Wchar: ::std::os::raw::c_ulong, - pub _Byte: ::std::os::raw::c_ushort, - pub _State: ::std::os::raw::c_ushort, -} -#[test] -fn bindgen_test_layout__Mbstatet() { - const UNINIT: ::std::mem::MaybeUninit<_Mbstatet> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_Mbstatet>(), - 8usize, - concat!("Size of: ", stringify!(_Mbstatet)) - ); - assert_eq!( - ::std::mem::align_of::<_Mbstatet>(), - 4usize, - concat!("Alignment of ", stringify!(_Mbstatet)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._Wchar) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_Wchar) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._Byte) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_Byte) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._State) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_State) - ) - ); -} -pub type mbstate_t = _Mbstatet; -pub type time_t = __time64_t; -pub type rsize_t = usize; -extern "C" { - pub fn _errno() -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn _set_errno(_Value: ::std::os::raw::c_int) -> errno_t; -} -extern "C" { - pub fn _get_errno(_Value: *mut ::std::os::raw::c_int) -> errno_t; -} -extern "C" { - pub fn __threadid() -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn __threadhandle() -> usize; -} -pub type int_least8_t = ::std::os::raw::c_schar; -pub type int_least16_t = ::std::os::raw::c_short; -pub type int_least32_t = ::std::os::raw::c_int; -pub type int_least64_t = ::std::os::raw::c_longlong; -pub type uint_least8_t = ::std::os::raw::c_uchar; -pub type uint_least16_t = ::std::os::raw::c_ushort; -pub type uint_least32_t = ::std::os::raw::c_uint; -pub type uint_least64_t = ::std::os::raw::c_ulonglong; -pub type int_fast8_t = ::std::os::raw::c_schar; -pub type int_fast16_t = ::std::os::raw::c_int; -pub type int_fast32_t = ::std::os::raw::c_int; -pub type int_fast64_t = ::std::os::raw::c_longlong; -pub type uint_fast8_t = ::std::os::raw::c_uchar; -pub type uint_fast16_t = ::std::os::raw::c_uint; -pub type uint_fast32_t = ::std::os::raw::c_uint; -pub type uint_fast64_t = ::std::os::raw::c_ulonglong; -pub type intmax_t = ::std::os::raw::c_longlong; -pub type uintmax_t = ::std::os::raw::c_ulonglong; #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum dxil_spirv_shader_stage { @@ -1346,13 +1087,3 @@ extern "C" { extern "C" { pub fn spirv_to_dxil_get_version() -> u64; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_locale_data { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_multibyte_data { - pub _address: u8, -}