Merge local/tests
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # crates/victory-gpu/src/indirect.rs
This commit is contained in:
commit
23b019755c
6 files changed
+144
-32
No files matched your search
@@ -1135,6 +1135,7 @@ mod tests {
|
||||
/// driver is what a run with `VICTORY_INPLACE_PROBE=1` adds.
|
||||
#[test]
|
||||
fn warp_probe_opens_title_like_memory_and_the_gpu_sees_its_bytes() {
|
||||
let _turn = crate::indirect::tests::warp_turn();
|
||||
let Some(device) = warp() else { return };
|
||||
if device.cast::<ID3D12Device13>().is_err() {
|
||||
eprintln!("no ID3D12Device13 here: parts of an allocation cannot be opened");
|
||||
@@ -1158,6 +1159,7 @@ mod tests {
|
||||
/// whole is turned down without asking the host.
|
||||
#[test]
|
||||
fn warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset() {
|
||||
let _turn = crate::indirect::tests::warp_turn();
|
||||
let Some(device) = warp() else { return };
|
||||
if device.cast::<ID3D12Device13>().is_err() {
|
||||
return;
|
||||
@@ -1178,7 +1180,16 @@ mod tests {
|
||||
assert!(same((start + 16) as *const u8, &[0xa5; 64]), "the GPU's write is at the title's address");
|
||||
drop(placed);
|
||||
// Half of it decommitted: turned down, the host not asked.
|
||||
assert_ne!(mem::VirtualFree(base.add(2 * K64).cast(), K64, mem::MEM_DECOMMIT), 0);
|
||||
// The heap lets go of the pages a moment after its last
|
||||
// reference, if the adapter is busy with other tests' work.
|
||||
let gone = (0..500).any(|_| {
|
||||
let done = mem::VirtualFree(base.add(2 * K64).cast(), K64, mem::MEM_DECOMMIT) != 0;
|
||||
if !done {
|
||||
std::thread::sleep(std::time::Duration::from_millis(10));
|
||||
}
|
||||
done
|
||||
});
|
||||
assert!(gone, "the heap keeps the pages");
|
||||
assert!(matches!(place_part(&device, start, len), Err(None)));
|
||||
mem::VirtualFree(base.cast(), 0, mem::MEM_RELEASE);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user