Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/xcl/src/hle/d3d12x/device_x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,13 @@ mod tests {
let old_cv: D3D12_CLEAR_VALUE = std::ptr::read_unaligned(pc_clear(&clear as *const _ as *const c_void, &mut old_buf) as *const _);
let new_cv: D3D12_CLEAR_VALUE = std::ptr::read_unaligned(pc_clear_for_desc(&clear as *const _ as *const c_void, pc_fmt, &mut new_buf) as *const _);
let mut r: Option<ID3D12Resource> = None;
assert!(dev.CreateCommittedResource(&heap, D3D12_HEAP_FLAG_NONE, &d, D3D12_RESOURCE_STATE_COMMON, Some(&old_cv), &mut r).is_err());
// Microsoft's runtime refuses a stale original-format clear value for a promoted
// desc. vkd3d-proton (under Wine) does not check it and creates the resource, so
// the refusal is asserted on Windows only; the promoted clear value below must
// still be accepted on both.
if !crate::util::under_wine() {
assert!(dev.CreateCommittedResource(&heap, D3D12_HEAP_FLAG_NONE, &d, D3D12_RESOURCE_STATE_COMMON, Some(&old_cv), &mut r).is_err());
}
assert_eq!(new_cv.Format.0 as u32, promoted_fmt);
dev.CreateCommittedResource(&heap, D3D12_HEAP_FLAG_NONE, &d, D3D12_RESOURCE_STATE_COMMON, Some(&new_cv), &mut r)
.unwrap_or_else(|e| panic!("promoted {orig_fmt}->{promoted_fmt} CreateCommittedResource failed: {e}"));
Expand Down
Loading