diff --git a/crates/victory-gpu/src/host/card_steps.rs b/crates/victory-gpu/src/host/card_steps.rs index 8bc2370..b26b975 100644 --- a/crates/victory-gpu/src/host/card_steps.rs +++ b/crates/victory-gpu/src/host/card_steps.rs @@ -1046,6 +1046,21 @@ mod tests { /// A copy at its place in a list is in the way of what reads or writes its /// bytes behind it, not of what did ahead of it. + /// Renderer port RT is the order's switch too: with it a fill ahead of + /// a copy at its place is let through, one behind it still refused. + #[test] + fn the_port_takes_the_order() { + crate::port_rt::PORT_RT_IN_TEST.set(true); + assert!(placed_order()); + let placed = Does::Placed { dst: 2000, src: 3000, len: 64 }; + let by_order = placed_order(); + assert!(plan(&[fill(2032, 64, true), placed], 2, by_order, &mut None).is_ok()); + assert_eq!(plan(&[placed, fill(2032, 64, true)], 2, by_order, &mut None), Err(BEHIND_PLACED)); + crate::port_rt::PORT_RT_IN_TEST.set(false); + // Without it (and without VICTORY_PLACED_ORDER) both were refused. + assert_eq!(plan(&[fill(2032, 64, true), placed], 2, false, &mut None), Err(BEHIND_PLACED)); + } + #[test] fn copies_at_their_place_stand_in_the_way_of_what_is_behind_them() { let placed = Does::Placed { dst: 2000, src: 3000, len: 64 }; diff --git a/crates/victory-gpu/src/host/rtbench.rs b/crates/victory-gpu/src/host/rtbench.rs index ebc5650..ee0675b 100644 --- a/crates/victory-gpu/src/host/rtbench.rs +++ b/crates/victory-gpu/src/host/rtbench.rs @@ -67,9 +67,9 @@ void main(uint id : SV_DispatchThreadID) { uint acc = 0; for (uint i = 0; i < steps; i++) { // The directory: the copy and the byte offset of the node's page. - uint2 e = dir.Load2((p >> 10) * 8); + uint2 e = spread == 99 ? uint2(0, (p >> 10) * 1024 * 64) : dir.Load2((p >> 10) * 8); uint copy = (e.x + ((id >> spread) & 7)) & 7; - if (spread == 0) { copy = e.x; } + if (spread == 0 || spread == 99) { copy = e.x; } uint at = e.y + (p & 1023) * 64; uint4 b, c, d; uint4 a = node(copy, at, b, c, d); @@ -234,8 +234,9 @@ fn bench_title_memory_reads() { back.Unmap(0, None); ms }; - let cases: [(&str, u32, u32); 7] = [ + let cases: [(&str, u32, u32); 8] = [ ("one view (uniform)", 0, 0), + ("one view, no directory", 0, 99), ("view per lane, all lanes one copy", 1, 0), ("one loop per node, all lanes one copy", 2, 0), ("the wave's view if shared, all lanes one copy", 3, 0),