mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-25 16:25:31 +00:00
More testing in device_memory
This commit is contained in:
parent
d4f51acfcd
commit
693ed347fa
@ -187,15 +187,32 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
fn oom() {
|
||||
fn oom_single() {
|
||||
let (device, _) = gfx_dev_and_queue!();
|
||||
let mem_ty = device.physical_device().memory_types().filter(|m| !m.is_lazily_allocated())
|
||||
.next().unwrap();
|
||||
|
||||
match DeviceMemory::alloc(&device, &mem_ty, 0xffffffffffffffff) {
|
||||
Err(OomError::OutOfDeviceMemory) => (),
|
||||
Err(OomError::OutOfHostMemory) => (),
|
||||
_ => panic!()
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore] // TODO: fails on AMD + Windows
|
||||
fn oom_multi() {
|
||||
let (device, _) = gfx_dev_and_queue!();
|
||||
let mem_ty = device.physical_device().memory_types().filter(|m| !m.is_lazily_allocated())
|
||||
.next().unwrap();
|
||||
let heap_size = mem_ty.heap().size();
|
||||
|
||||
for _ in 0 .. 4 {
|
||||
match DeviceMemory::alloc(&device, &mem_ty, heap_size / 3) {
|
||||
Err(OomError::OutOfDeviceMemory) => return, // test succeeded
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
||||
panic!()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user