diff --git a/crates/xcl/src/hle/d3d12x/texture_upload.rs b/crates/xcl/src/hle/d3d12x/texture_upload.rs index 16e06fd028..da7e270168 100644 --- a/crates/xcl/src/hle/d3d12x/texture_upload.rs +++ b/crates/xcl/src/hle/d3d12x/texture_upload.rs @@ -999,7 +999,7 @@ mod tests { let mut at = seed * 37 % size.div_ceil(PAGE) * PAGE; let mut n = seed; while at < size && out.len() < 6 { - n = n * 1103515245 + 12345; + n = n.wrapping_mul(1103515245).wrapping_add(12345); let to = (at + PAGE * (1 + n / 65536 % 4)).min(size); out.push((at, to)); at = to + PAGE * (1 + n / 16 % (size / PAGE / 5 + 2)); diff --git a/crates/xcl/tests/d3d12_mesh_stream.rs b/crates/xcl/tests/d3d12_mesh_stream.rs index d742ee26d0..f349efa48b 100644 --- a/crates/xcl/tests/d3d12_mesh_stream.rs +++ b/crates/xcl/tests/d3d12_mesh_stream.rs @@ -2,8 +2,9 @@ //! (`d3d12x::real::dev_create_pipeline_state` / `translated_mesh_stream`), with no game data. //! //! Runs on any D3D12 adapter (AMD, NVIDIA, Intel, or WARP) with zero vendor-specific skips: -//! 1. Synthetic console MS placed in the AS slot with no MS slot is refused cleanly with -//! `E_INVALIDARG` and records the `"in the AS slot – refused"` error. +//! 1. Synthetic console MS placed in the AS slot with no MS slot is taken as the mesh shader it +//! is (`real::mesh_shader_slots`) and, having no NGG variant, fails cleanly with +//! `E_INVALIDARG` as an MS translation error, not as an AS-slot refusal. //! 2. Synthetic console MS paired with an AS subobject is refused cleanly with `E_INVALIDARG`. //! 3. Empty, truncated, unknown-subobject, and unreadable-shader pipeline streams fail cleanly //! without panicking or crashing. @@ -93,10 +94,11 @@ fn console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly() { }; let err = unsafe { d2.CreatePipelineState::(&desc) }.expect_err("MS in AS slot must be refused"); assert_eq!(err.code(), E_INVALIDARG); + // translated as the MS (the synthetic container has no NGG variant), not refused for the slot + let errors = real::stats().translation_errors; assert!( - real::stats().translation_errors.iter().any(|e| e.contains("in the AS slot")), - "expected AS-slot refusal in translation_errors: {:?}", - real::stats().translation_errors + errors.iter().any(|e| e.starts_with("MS: ")) && !errors.iter().any(|e| e.contains("in the AS slot")), + "expected an MS translation error and no AS-slot refusal in translation_errors: {errors:?}" ); // Case 2: console MS paired with an AS subobject diff --git a/crates/xcl/tests/gpu_compute_e2e.rs b/crates/xcl/tests/gpu_compute_e2e.rs index 5ffa519a96..e18cc8af86 100644 --- a/crates/xcl/tests/gpu_compute_e2e.rs +++ b/crates/xcl/tests/gpu_compute_e2e.rs @@ -530,8 +530,13 @@ fn async_compute_pso_registers_real_pso_and_not_standin() { assert!(!real::is_translated_compute(standin_raw), "stand-in must remain unregistered after background build"); assert!(real::pso_root_signature(real_raw).is_some(), "real compute PSO must have an ABI root signature"); - // Releasing the stand-in must release and forget the background-built real PSO too. + // Releasing the stand-in must release and forget the background-built real PSO too. The real + // one goes once the queues are past a fence (`late_release::hold_pipeline`), not in the drop. drop(pso); + let start = std::time::Instant::now(); + while real::is_translated_compute(real_raw) && start.elapsed() < std::time::Duration::from_secs(10) { + std::thread::sleep(std::time::Duration::from_millis(5)); + } assert!(!real::is_translated_compute(real_raw), "forgetting released async compute PSO must clean up TRANSLATED_COMPUTE"); } diff --git a/crates/xcl/tests/gpu_two_pass_cache_e2e.rs b/crates/xcl/tests/gpu_two_pass_cache_e2e.rs index c1c74a9840..61a5e2dc76 100644 --- a/crates/xcl/tests/gpu_two_pass_cache_e2e.rs +++ b/crates/xcl/tests/gpu_two_pass_cache_e2e.rs @@ -646,6 +646,12 @@ float4 main(V v) : SV_Target0 { return v.p0; } assert_eq!(draw_two_pass_and_read(&dev, &gs, 1, true), [0.0, 1.0, 0.0, 1.0]); assert_eq!(real::two_pass_count(), before + 3); drop((ms1, ms2, gs)); + // (the real pipelines behind the stand-ins go once the queues are past a fence: + // `late_release::hold_pipeline`, not in the drop) + let start = std::time::Instant::now(); + while real::two_pass_count() != before && start.elapsed() < std::time::Duration::from_secs(10) { + std::thread::sleep(std::time::Duration::from_millis(5)); + } assert_eq!(real::two_pass_count(), before, "releasing the title PSOs releases their two-pass state"); if dev.cast::().is_ok() {