From 1aca319f0b61d4422caf3c653bc0bb49444fcf7e Mon Sep 17 00:00:00 2001 From: Tjabooo Date: Tue, 24 Nov 2026 17:40:02 +0100 Subject: [PATCH] Tests: assert the refused depth-buffer UAV state on Windows only gpu_depth_buffer_created_for_unordered_access_is_placed (#1353) first checks that a depth buffer without the UAV flag can't be placed in UNORDERED_ACCESS. Microsoft's D3D12 runtime refuses that state; vkd3d-proton under Wine does not validate it and creates the resource, so the test failed on every Linux run although the state XCL asks for (DEPTH_WRITE, from pc_initial_state) is accepted there too. The refusal is now asserted only when not under Wine; the rest of the test is unchanged. Co-Authored-By: Claude Opus 5.5 --- crates/xcl/src/hle/d3d12x/device_x.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/xcl/src/hle/d3d12x/device_x.rs b/crates/xcl/src/hle/d3d12x/device_x.rs index 4b6d32aa79..944ca17560 100644 --- a/crates/xcl/src/hle/d3d12x/device_x.rs +++ b/crates/xcl/src/hle/d3d12x/device_x.rs @@ -1110,7 +1110,12 @@ mod tests { let mut r: Option = None; dev.CreatePlacedResource(&heap, 0, &d, D3D12_RESOURCE_STATES(state as i32), None, &mut r).map(|_| r) }; - assert!(place(0x8 & real::PC_RESOURCE_STATES).is_err(), "UNORDERED_ACCESS without the UAV flag"); + // Microsoft's runtime refuses this state for a resource without the UAV flag. vkd3d-proton + // (under Wine) does not check it and creates the resource, so the refusal is asserted on + // Windows only; the state XCL asks for is checked on both below. + if !crate::util::under_wine() { + assert!(place(0x8 & real::PC_RESOURCE_STATES).is_err(), "UNORDERED_ACCESS without the UAV flag"); + } let state = pc_initial_state(6, 0x8); assert_eq!(state, D3D12_RESOURCE_STATE_DEPTH_WRITE.0 as u32); let r = place(state).unwrap_or_else(|e| panic!("placed in {state:#x}: {e}"));