Add ptrchain external test file
This commit is contained in:
parent
1744159dfd
commit
2d730cdf65
21
ash/tests/ptrchain.rs
Normal file
21
ash/tests/ptrchain.rs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
extern crate ash;
|
||||||
|
use ash::vk;
|
||||||
|
#[test]
|
||||||
|
fn test_ptr_chains() {
|
||||||
|
let mut variable_pointers = vk::PhysicalDeviceVariablePointerFeatures::builder();
|
||||||
|
let mut corner = vk::PhysicalDeviceCornerSampledImageFeaturesNV::builder();
|
||||||
|
let chain = vec![
|
||||||
|
&variable_pointers as *const _ as usize,
|
||||||
|
&corner as *const _ as usize,
|
||||||
|
];
|
||||||
|
let mut device_create_info = vk::DeviceCreateInfo::builder()
|
||||||
|
.push_next(&mut corner)
|
||||||
|
.push_next(&mut variable_pointers);
|
||||||
|
let chain2: Vec<usize> = unsafe {
|
||||||
|
vk::ptr_chain_iter(&mut device_create_info)
|
||||||
|
.skip(1)
|
||||||
|
.map(|ptr| ptr as usize)
|
||||||
|
.collect()
|
||||||
|
};
|
||||||
|
assert_eq!(chain, chain2);
|
||||||
|
}
|
Loading…
Reference in a new issue