From b9d6a9831bb415904f991e1a461e42356966cbcb Mon Sep 17 00:00:00 2001 From: Robin Snyders Date: Mon, 23 Nov 2026 19:02:58 +0100 Subject: [PATCH 1/3] D3D12.X: Xbox D16S8 depth formats and depth buffers that are also UAVs The console's DXGI_FORMAT_D16_UNORM_S8_UINT family (118, 119, 120) does not exist on the PC: it becomes the D24_UNORM_S8_UINT family (45, 46, 47) in resource descs and in pipelines' DSV / RTV formats (pc_format). The console allows a depth-stencil resource that is also a UAV; the PC refuses that pair, so pc_resource_desc keeps the depth flag and drops unordered access, and a placed depth buffer's UNORDERED_ACCESS initial state becomes DEPTH_WRITE. GTA VI stopped on assertions at +0x344196 (its 2560x1440 D16S8 depth buffer got no size from GetResourceAllocationInfo) and +0x14a6390 (its 768x768x6 shadow maps, placed with the UAV state, were refused). Resources that still get no size or are refused are logged with their PC desc. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B --- crates/xcl/src/hle/d3d12x/device_x.rs | 49 +++++++++++++++++++++++++-- crates/xcl/src/hle/d3d12x/real.rs | 6 ++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/crates/xcl/src/hle/d3d12x/device_x.rs b/crates/xcl/src/hle/d3d12x/device_x.rs index 403b7af299..e119cbf149 100644 --- a/crates/xcl/src/hle/d3d12x/device_x.rs +++ b/crates/xcl/src/hle/d3d12x/device_x.rs @@ -654,10 +654,28 @@ pub fn pc_resource_desc(x: &[u8; 0x38]) -> [u8; 0x38] { d[8..16].fill(0); // alignment: the driver's let layout = if dim == D3D12_RESOURCE_DIMENSION_BUFFER.0 as u32 { D3D12_TEXTURE_LAYOUT_ROW_MAJOR.0 } else { D3D12_TEXTURE_LAYOUT_UNKNOWN.0 }; d[0x2C..0x30].copy_from_slice(&(layout as u32).to_le_bytes()); - d[0x30..0x34].copy_from_slice(&(flags & 0xFF).to_le_bytes()); + // a depth buffer the console also writes as a UAV (GTA VI's 2560x1440 D16S8): the PC refuses + // depth + unordered access together, and the resource got no size + let pc_flags = if flags & 0x2 != 0 { flags & 0xFF & !0x4 } else { flags & 0xFF }; + d[0x30..0x34].copy_from_slice(&pc_flags.to_le_bytes()); + let format = u32::from_le_bytes(d[0x20..0x24].try_into().unwrap()); + d[0x20..0x24].copy_from_slice(&pc_format(format).to_le_bytes()); d } +/// A DXGI format of the console only as the PC's nearest: the 16-bit depth + 8-bit stencil +/// family (118 D16_UNORM_S8_UINT, 119 R16_UNORM_X8_TYPELESS, 120 X16_TYPELESS_G8_UINT) as the +/// 24-bit one (45, 46, 47). The PC driver refuses them: GTA VI's depth buffer got no size +/// (GetResourceAllocationInfo) and the title stopped on its assertion. +pub fn pc_format(f: u32) -> u32 { + match f { + 118 => 45, + 119 => 46, + 120 => 47, + f => f, + } +} + /// device #25 GetResourceAllocationInfo(visible mask, count, descs) → {size, alignment}, /// returned through a hidden pointer. Called the C way – (return buffer, device, …), XDefiant – /// or the C++ way – (device, return buffer, …): whichever argument is the device is `this`. @@ -680,6 +698,10 @@ pub(super) unsafe extern "system" fn get_resource_allocation_info_x(a: *mut c_vo } }; if s == u64::MAX || a == 0 { + static N: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0); + if N.fetch_add(1, std::sync::atomic::Ordering::Relaxed) < 8 { + crate::xlog_warn!("D3D12.X: GetResourceAllocationInfo: no size for {:x?} (as the PC's: {:x?})", &x[..0x34], &pc_resource_desc(&x)[..0x34]); + } size = u64::MAX; break; } @@ -767,7 +789,12 @@ pub(super) unsafe extern "system" fn create_placed_resource_x(this: *mut c_void, note_alias(va as usize, &x); // console-only state bits (Unicorn Overlord's 4K display target: 0x100000) are not the // PC's: the PC refused the resource (E_INVALIDARG) and the title threw - let state = state & real::PC_RESOURCE_STATES; + let mut state = state & real::PC_RESOURCE_STATES; + // a depth buffer is no UAV on the PC (`pc_resource_desc`): its unordered-access initial state + // (GTA VI's 768x768x6 shadow maps: 0x8) is refused – it starts as a depth target + if u32::from_le_bytes(d[0x30..0x34].try_into().unwrap()) & 0x2 != 0 && state & 0x8 != 0 { + state = (state & !0x8) | 0x10; + } if buffer { if let Some(hr) = real::place_at_title_address(this, va as usize, &d, state, clear, riid, ppv) { return hr; @@ -811,6 +838,10 @@ pub(super) unsafe extern "system" fn create_placed_resource_x(this: *mut c_void, w(0x20), w(0x30) ); + if hr < 0 { + let cf = if clear.is_null() { -1 } else { *(clear as *const i32) }; + crate::xlog_info!("D3D12.X: … its state {state:#x}, clear value format {cf}, as the PC's {:x?}", &d[..0x34]); + } } hr } @@ -916,6 +947,20 @@ mod tests { assert_eq!(u32::from_le_bytes(pc_resource_desc(&x)[0x2C..0x30].try_into().unwrap()), 0); } + #[test] + fn console_depth_buffers_become_pc_ones() { + let mut x = [0u8; 0x38]; + x[0] = 3; // texture 2D + x[0x20] = 118; // D16_UNORM_S8_UINT + x[0x30..0x34].copy_from_slice(&0x8030_0006u32.to_le_bytes()); // depth + UAV + console bits + let d = pc_resource_desc(&x); + let u = |o: usize| u32::from_le_bytes(d[o..o + 4].try_into().unwrap()); + assert_eq!((u(0x20), u(0x30)), (45, 0x2)); + x[0x30..0x34].copy_from_slice(&0x4u32.to_le_bytes()); // a UAV texture keeps it + assert_eq!(u32::from_le_bytes(pc_resource_desc(&x)[0x30..0x34].try_into().unwrap()), 0x4); + assert_eq!((pc_format(119), pc_format(120), pc_format(28)), (46, 47, 28)); + } + #[test] fn derived_pipeline_patches_land_on_the_desc_parts() { use std::mem::{offset_of, size_of}; diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs index 3e7a44f192..30c2214e70 100644 --- a/crates/xcl/src/hle/d3d12x/real.rs +++ b/crates/xcl/src/hle/d3d12x/real.rs @@ -3585,6 +3585,12 @@ unsafe fn fallback_stream(desc: *const u8) -> Option<(Vec, [usize; 2])> { /// `list_x::RECT_LIST`) is TRIANGLE, as those draws become triangle lists; UNDEFINED (a stream /// without one) is TRIANGLE, or PATCH with a hull shader – the PC refuses both with a VS. fn pc_topology_type(g: &mut D3D12_GRAPHICS_PIPELINE_STATE_DESC) { + // the console's own depth format DXGI_FORMAT_D16_UNORM_S8_UINT (118) is not the PC's: the + // driver refuses the pipeline (GTA VI's); D24_UNORM_S8_UINT has the depth and the stencil + g.DSVFormat.0 = super::device_x::pc_format(g.DSVFormat.0 as u32) as i32; + for f in g.RTVFormats.iter_mut() { + f.0 = super::device_x::pc_format(f.0 as u32) as i32; + } if !(1..=4).contains(&g.PrimitiveTopologyType.0) { g.PrimitiveTopologyType = if g.HS.pShaderBytecode.is_null() { D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE } else { D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH }; } From 634c4238b3b4a640ad137674aa53db2f954d517b Mon Sep 17 00:00:00 2001 From: Robin Snyders Date: Mon, 23 Nov 2026 20:18:42 +0100 Subject: [PATCH 2/3] D3D12.X: a null UAV for a resource the PC has without unordered access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pc_resource_desc drops ALLOW_UNORDERED_ACCESS from a console depth buffer that is also a UAV. GTA VI still creates UAVs of its 768x768 shadow maps: the driver was handed an invalid view (debug layer: "CreateUnorderedAccessView … did not specify ALLOW_UNORDERED_ACCESS") and the device was removed once a dispatch used it. The PC descriptor is now a null view of the same dimension; the console descriptor XCL writes for translated shaders is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B --- crates/xcl/src/hle/d3d12x/real.rs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs index 30c2214e70..66b2d9be4c 100644 --- a/crates/xcl/src/hle/d3d12x/real.rs +++ b/crates/xcl/src/hle/d3d12x/real.rs @@ -1785,8 +1785,31 @@ unsafe extern "system" fn dev_create_uav_x(this: *mut c_void, res: *mut c_void, crate::xlog_info!("frame trace: UAV of render target {res:p} {:?} at {cpu:#x}: console slot {:?}, view {:?}", d.map(|d| (d.Width, d.Height, d.Format.0)), s.as_ref().map(|s| (s.index, s.pc_uav, s.at)), desc.as_ref().map(|v| (v.Format.0, v.ViewDimension.0))); } } - let Some(slot) = super::console_heap::slot(cpu) else { return f(this, res, counter, desc, cpu) }; - f(this, res, counter, desc, slot.pc_uav); + // a resource the PC has without unordered access (a console depth buffer that is also a UAV, + // `device_x::pc_resource_desc`): a null view of the same dimension – the view of it the + // driver was handed removed the device once a dispatch used it (GTA VI, ~25 s in) + let null_desc; + let (res_pc, counter, desc_pc) = match ID3D12Resource::from_raw_borrowed(&res).map(|r| r.GetDesc()) { + Some(rd) if rd.Flags.0 & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS.0 == 0 => { + static N: AtomicU64 = AtomicU64::new(0); + if N.fetch_add(1, Ordering::Relaxed) < 4 { + crate::xlog_info!( + "D3D12.X: UAV of a resource without unordered access ({}x{}, format {}, flags {:#x}) – a null view", + rd.Width, + rd.Height, + rd.Format.0, + rd.Flags.0 + ); + } + let mut d = desc.as_ref().copied().unwrap_or(D3D12_UNORDERED_ACCESS_VIEW_DESC { ViewDimension: D3D12_UAV_DIMENSION(resource_dim_to_view(&rd) as i32), ..Default::default() }); + d.Format = windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R32_UINT; + null_desc = d; + (std::ptr::null_mut(), std::ptr::null_mut(), &null_desc as *const D3D12_UNORDERED_ACCESS_VIEW_DESC) + } + _ => (res, counter, desc), + }; + let Some(slot) = super::console_heap::slot(cpu) else { return f(this, res_pc, counter, desc_pc, cpu) }; + f(this, res_pc, counter, desc_pc, slot.pc_uav); super::console_heap::publish(&slot, true); super::console_heap::note_resource(&slot, res as usize); let Some(r) = ID3D12Resource::from_raw_borrowed(&res) else { From 595b2b7a8446d9bf912ae602547476adcb21ef50 Mon Sep 17 00:00:00 2001 From: Robin Snyders Date: Mon, 23 Nov 2026 20:59:14 +0100 Subject: [PATCH 3/3] D3D12.X: the PC's formats for clear values and views of console depth buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #163 makes the console's D16S8 depth buffers D24S8 on the PC; what refers to them kept the console's formats and the PC refused them (GTA VI, with the D3D12 debug layer): - a clear value of format 118 on a D24S8 resource: E_INVALIDARG, then the title's assertion; - CreateDepthStencilView with format 118 (now hooked): the device was removed (~55 s in); - SRVs of depth / stencil planes as R16_UNORM, R8_UINT, and of a D32S8 (R32G8X24_TYPELESS) as R32_FLOAT – also the SRV XCL makes next to a texture UAV: now R24_UNORM_X8_TYPELESS / X24_TYPELESS_G8_UINT / R32_FLOAT_X8X24_TYPELESS / X32_TYPELESS_G8X24_UINT with the matching plane slice (`depth_srv_format`); - the null UAV of a depth buffer kept the console view's plane slice 1. RTVs and SRVs with 118–120 go through `pc_format` too. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SKtJseucqXR6iuAE6HBtiA --- crates/xcl/src/hle/d3d12x/device_x.rs | 17 ++++++ crates/xcl/src/hle/d3d12x/real.rs | 85 +++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/crates/xcl/src/hle/d3d12x/device_x.rs b/crates/xcl/src/hle/d3d12x/device_x.rs index e119cbf149..5abc460510 100644 --- a/crates/xcl/src/hle/d3d12x/device_x.rs +++ b/crates/xcl/src/hle/d3d12x/device_x.rs @@ -676,6 +676,19 @@ pub fn pc_format(f: u32) -> u32 { } } +/// A copy of the clear value with its format as the PC's (`pc_format`), when that differs. +unsafe fn pc_clear_value(clear: *const c_void) -> Option { + if clear.is_null() || !crate::gpu::shader::readable(clear as usize, std::mem::size_of::()) { + return None; + } + let mut c = (clear as *const D3D12_CLEAR_VALUE).read_unaligned(); + let f = pc_format(c.Format.0 as u32); + (f != c.Format.0 as u32).then(|| { + c.Format.0 = f as i32; + c + }) +} + /// device #25 GetResourceAllocationInfo(visible mask, count, descs) → {size, alignment}, /// returned through a hidden pointer. Called the C way – (return buffer, device, …), XDefiant – /// or the C++ way – (device, return buffer, …): whichever argument is the device is `this`. @@ -790,6 +803,10 @@ pub(super) unsafe extern "system" fn create_placed_resource_x(this: *mut c_void, // console-only state bits (Unicorn Overlord's 4K display target: 0x100000) are not the // PC's: the PC refused the resource (E_INVALIDARG) and the title threw let mut state = state & real::PC_RESOURCE_STATES; + // its clear value in the PC's format too (`pc_format`): D16S8 (118) against the resource's + // D24S8 was refused (GTA VI's 1024x1024 depth buffers, E_INVALIDARG, then its assertion) + let clear_pc = pc_clear_value(clear); + let clear = clear_pc.as_ref().map_or(clear, |c| c as *const D3D12_CLEAR_VALUE as *const c_void); // a depth buffer is no UAV on the PC (`pc_resource_desc`): its unordered-access initial state // (GTA VI's 768x768x6 shadow maps: 0x8) is refused – it starts as a depth target if u32::from_le_bytes(d[0x30..0x34].try_into().unwrap()) & 0x2 != 0 && state & 0x8 != 0 { diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs index 66b2d9be4c..45120f5412 100644 --- a/crates/xcl/src/hle/d3d12x/real.rs +++ b/crates/xcl/src/hle/d3d12x/real.rs @@ -1627,6 +1627,19 @@ unsafe extern "system" fn heap_release(this: *mut c_void) -> u32 { } unsafe extern "system" fn dev_create_srv_x(this: *mut c_void, res: *mut c_void, desc: *const D3D12_SHADER_RESOURCE_VIEW_DESC, cpu: u64) { + let mut pc_view = pc_view_desc(desc); + if let (Some(rd), Some(mut v)) = (ID3D12Resource::from_raw_borrowed(&res).map(|r| r.GetDesc()), pc_view.or_else(|| desc.as_ref().copied())) { + if let Some((format, plane)) = depth_srv_format(rd.Format.0 as u32, v.Format.0 as u32) { + v.Format.0 = format as i32; + match v.ViewDimension { + D3D12_SRV_DIMENSION_TEXTURE2D => v.Anonymous.Texture2D.PlaneSlice = plane, + D3D12_SRV_DIMENSION_TEXTURE2DARRAY => v.Anonymous.Texture2DArray.PlaneSlice = plane, + _ => {} + } + pc_view = Some(v); + } + } + let desc = pc_view.as_ref().map_or(desc, |v| v as *const D3D12_SHADER_RESOURCE_VIEW_DESC); let f: unsafe extern "system" fn(*mut c_void, *mut c_void, *const D3D12_SHADER_RESOURCE_VIEW_DESC, u64) = std::mem::transmute(orig_fn(this, 18)); let Some(slot) = super::console_heap::slot(cpu) else { return f(this, res, desc, cpu) }; // Raytracing acceleration structure SRV (pResource == NULL, Location == console GPU VA): @@ -1803,6 +1816,11 @@ unsafe extern "system" fn dev_create_uav_x(this: *mut c_void, res: *mut c_void, } let mut d = desc.as_ref().copied().unwrap_or(D3D12_UNORDERED_ACCESS_VIEW_DESC { ViewDimension: D3D12_UAV_DIMENSION(resource_dim_to_view(&rd) as i32), ..Default::default() }); d.Format = windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R32_UINT; + match d.ViewDimension { + D3D12_UAV_DIMENSION_TEXTURE2D => d.Anonymous.Texture2D.PlaneSlice = 0, + D3D12_UAV_DIMENSION_TEXTURE2DARRAY => d.Anonymous.Texture2DArray.PlaneSlice = 0, + _ => {} + } null_desc = d; (std::ptr::null_mut(), std::ptr::null_mut(), &null_desc as *const D3D12_UNORDERED_ACCESS_VIEW_DESC) } @@ -1849,6 +1867,12 @@ unsafe extern "system" fn dev_create_uav_x(this: *mut c_void, res: *mut c_void, Shader4ComponentMapping: D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, Anonymous: D3D12_SHADER_RESOURCE_VIEW_DESC_0 { Texture2D: D3D12_TEX2D_SRV { MostDetailedMip: mip, MipLevels: 1, PlaneSlice: 0, ResourceMinLODClamp: 0.0 } }, }; + // (of a depth buffer: the PC format of its depth or stencil plane, `depth_srv_format`) + let mut srv = srv; + if let Some((format, plane)) = depth_srv_format(rd.Format.0 as u32, srv.Format.0 as u32) { + srv.Format.0 = format as i32; + srv.Anonymous.Texture2D.PlaneSlice = plane; + } let g: unsafe extern "system" fn(*mut c_void, *mut c_void, *const D3D12_SHADER_RESOURCE_VIEW_DESC, u64) = std::mem::transmute(orig_fn(this, 18)); g(this, res, &srv, slot.pc_srv); super::console_heap::publish(&slot, false); @@ -1999,6 +2023,7 @@ fn overrides(kind: Kind) -> Vec<(&'static str, usize)> { ("CreateDescriptorHeap", dev_create_descriptor_heap as usize), ("CreateRootSignature", dev_create_root_signature as usize), ("CreateRenderTargetView", dev_create_rtv as usize), + ("CreateDepthStencilView", dev_create_dsv as usize), ("CreateCommittedResource", dev_create_committed_resource as usize), ("CreateHeap", dev_create_heap as usize), ("CreatePlacedResource", dev_create_placed_resource as usize), @@ -3835,6 +3860,8 @@ unsafe extern "system" fn dev_create_root_signature(this: *mut c_void, mask: u32 unsafe extern "system" fn dev_create_rtv(this: *mut c_void, res: *mut c_void, desc: *const c_void, handle: usize) { type F = unsafe extern "system" fn(*mut c_void, *mut c_void, *const c_void, usize); let f: F = std::mem::transmute(orig_fn(this, slot_of(this, "CreateRenderTargetView"))); + let pc_view = pc_view_desc(desc as *const D3D12_RENDER_TARGET_VIEW_DESC); + let desc = pc_view.as_ref().map_or(desc, |v| v as *const D3D12_RENDER_TARGET_VIEW_DESC as *const c_void); f(this, res, desc, handle); super::present::note_rtv(handle, res); if super::present::trace_frame() { @@ -3846,6 +3873,45 @@ unsafe extern "system" fn dev_create_rtv(this: *mut c_void, res: *mut c_void, de } } +/// CreateDepthStencilView with the PC's format (`device_x::pc_format`): GTA VI's D16S8 views +/// (118) of its depth buffers, which are D24S8 on the PC, were invalid and the device was +/// removed (~55 s in). +unsafe extern "system" fn dev_create_dsv(this: *mut c_void, res: *mut c_void, desc: *const D3D12_DEPTH_STENCIL_VIEW_DESC, handle: usize) { + type F = unsafe extern "system" fn(*mut c_void, *mut c_void, *const D3D12_DEPTH_STENCIL_VIEW_DESC, usize); + let f: F = std::mem::transmute(orig_fn(this, slot_of(this, "CreateDepthStencilView"))); + let pc_view = pc_view_desc(desc); + f(this, res, pc_view.as_ref().map_or(desc, |v| v as *const _), handle) +} + +/// The SRV format (and plane) the PC takes for a view of a depth + stencil resource: the console +/// reads the depth of a D32S8 (R32G8X24) as R32_FLOAT, of a D24S8 (D16S8 on the console) as +/// R16_UNORM, its stencil as R8_UINT – each invalid on the PC (GTA VI: the device was removed). +fn depth_srv_format(resource: u32, view: u32) -> Option<(u32, u32)> { + let stencil = matches!(view, 62 | 22 | 47 | 120); + let r = match (resource, stencil) { + (19 | 20, false) => (21, 0), + (19 | 20, true) => (22, 1), + (44 | 45, false) => (46, 0), + (44 | 45, true) => (47, 1), + _ => return None, + }; + (r != (view, if stencil { 1 } else { 0 }) || r.0 != view).then_some(r) +} + +/// A copy of a view desc (its DXGI_FORMAT first) with the PC's format, when that differs. +unsafe fn pc_view_desc(desc: *const T) -> Option { + if desc.is_null() || !crate::gpu::shader::readable(desc as usize, std::mem::size_of::()) { + return None; + } + let mut v = desc.read_unaligned(); + let at = &mut v as *mut T as *mut u32; + let f = super::device_x::pc_format(*at); + (f != *at).then(|| { + *at = f; + v + }) +} + /// ClearRenderTargetView: as on the PC (`XCL_TRACE_FRAME`: the colours logged) unsafe extern "system" fn cl_clear_rtv(this: *mut c_void, rtv: usize, color: *const [f32; 4], n: u32, rects: *const c_void) { type F = unsafe extern "system" fn(*mut c_void, usize, *const [f32; 4], u32, *const c_void); @@ -4559,3 +4625,22 @@ mod queue_tests { QUEUE_OLDER.store(false, Ordering::Release); } } + +#[cfg(test)] +mod depth_view_tests { + use super::depth_srv_format; + + #[test] + fn console_depth_views_become_pc_ones() { + // D32S8 (R32G8X24_TYPELESS): depth as R32_FLOAT_X8X24_TYPELESS, stencil plane 1 + assert_eq!(depth_srv_format(19, 41), Some((21, 0))); + assert_eq!(depth_srv_format(20, 62), Some((22, 1))); + // D24S8 (the console's D16S8): depth R24_UNORM_X8_TYPELESS, stencil X24_TYPELESS_G8_UINT + assert_eq!(depth_srv_format(45, 56), Some((46, 0))); + assert_eq!(depth_srv_format(45, 62), Some((47, 1))); + assert_eq!(depth_srv_format(45, 119), Some((46, 0))); + // already the PC's, or not a depth resource: unchanged + assert_eq!(depth_srv_format(45, 46), None); + assert_eq!(depth_srv_format(28, 28), None); + } +}