upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/device_proxy_test.cpp
diff options
context:
space:
mode:
authorASTROWwwW <astrxwledev@gmail.com>2026-11-23 19:23:16 +0100
committerASTROWwwW <astrxwledev@gmail.com>2026-11-23 19:23:16 +0100
commitf5b7ebf9186f84ba9bbc197ba5a123fa89a4856c (patch)
tree9d4a4dac65f1f1d5b4fa9e44dcb264e1b477f417 /runtime/test/device_proxy_test.cpp
parentfb23d93c13182b6bf47edd4d556e35bc6d817b2f (diff)
parent4a86034367eacdfca77298d89e37a5bc8545e4e5 (diff)
Merge branch 'pr7679' into ladder-frame
Diffstat (limited to 'runtime/test/device_proxy_test.cpp')
-rw-r--r--runtime/test/device_proxy_test.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/runtime/test/device_proxy_test.cpp b/runtime/test/device_proxy_test.cpp
index 6b7a78938..670719dca 100644
--- a/runtime/test/device_proxy_test.cpp
+++ b/runtime/test/device_proxy_test.cpp
@@ -227,6 +227,44 @@ int main(int argc, char** argv) {
227 const D3D12_RESOURCE_ALLOCATION_INFO pc_info = device->GetResourceAllocationInfo(0, 1, &desc); 227 const D3D12_RESOURCE_ALLOCATION_INFO pc_info = device->GetResourceAllocationInfo(0, 1, &desc);
228 check(pc_info.SizeInBytes == want.SizeInBytes && pc_info.Alignment == want.Alignment, 228 check(pc_info.SizeInBytes == want.SizeInBytes && pc_info.Alignment == want.Alignment,
229 "slot 25 still answers the PC (C++) form"); 229 "slot 25 still answers the PC (C++) form");
230
231 // A console depth-stencil texture that allows unordered access too, as a title sizes one: a 2D
232 // R32G8X24_TYPELESS texture with ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS and the console layout word. The
233 // PC device refuses the flag pair (negative control); slot 25 sizes it as the depth-stencil texture alone.
234 D3D12_RESOURCE_DESC ds_uav{};
235 ds_uav.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
236 ds_uav.Width = 2560;
237 ds_uav.Height = 1440;
238 ds_uav.DepthOrArraySize = 1;
239 ds_uav.MipLevels = 1;
240 ds_uav.Format = DXGI_FORMAT_R32G8X24_TYPELESS;
241 ds_uav.SampleDesc.Count = 1;
242 ds_uav.Layout = static_cast<D3D12_TEXTURE_LAYOUT>(0x101);
243 ds_uav.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
244 D3D12_RESOURCE_DESC pc_pair = ds_uav;
245 pc_pair.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
246 check(real->GetResourceAllocationInfo(0, 1, &pc_pair).SizeInBytes == UINT64_MAX,
247 "the PC device refuses a depth-stencil texture with unordered access (negative control)");
248 D3D12_RESOURCE_DESC ds_only = pc_pair;
249 ds_only.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
250 const D3D12_RESOURCE_ALLOCATION_INFO ds_want = real->GetResourceAllocationInfo(0, 1, &ds_only);
251 check(ds_want.SizeInBytes != UINT64_MAX, "WARP sizes the depth-stencil texture without unordered access");
252 const D3D12_RESOURCE_DESC ds_clean = rt::d3d12_xs::pc_resource_desc(ds_uav);
253 check(ds_clean.Flags == D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL,
254 "pc_resource_desc drops unordered access from a depth-stencil texture");
255 D3D12_RESOURCE_DESC uav_buffer = buffer_desc();
256 uav_buffer.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
257 D3D12_RESOURCE_DESC rt_uav = ds_only;
258 rt_uav.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
259 rt_uav.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
260 check(rt::d3d12_xs::pc_resource_desc(uav_buffer).Flags == D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS &&
261 rt::d3d12_xs::pc_resource_desc(rt_uav).Flags == rt_uav.Flags,
262 "pc_resource_desc keeps unordered access on buffers and color textures");
263 D3D12_RESOURCE_ALLOCATION_INFO ds_got{~0ull, ~0ull};
264 get_alloc_info(&ds_got, device.Get(), 0, 1, &ds_uav);
265 check(ds_got.SizeInBytes != UINT64_MAX && ds_got.SizeInBytes >= ds_want.SizeInBytes &&
266 (ds_got.SizeInBytes >> 32) == 0,
267 "slot 25 (C ABI) sizes a console depth-stencil texture with unordered access");
230 } 268 }
231 269
232 D3D12_RESOURCE_DESC reserved_desc = buffer_desc(); 270 D3D12_RESOURCE_DESC reserved_desc = buffer_desc();