Repository navigation
Runtime: per-type descriptor slot sizes and heap handles (P0/P1) - #333
kontaktjakubjagiello wants to merge 1 commit into
Conversation
P0: GetDescriptorHandleIncrementSize answers per heap type, CreateDescriptorHeap rejects an unknown type, DescriptorHeap keeps its own stride and slot count, and a device-wide heap registry maps a CPU handle back to its heap. P1: CopyDescriptors/CopyDescriptorsSimple resolve both heaps, use the destination heap's stride, clamp to the heap, and mark the copied slots dirty for the bindless scan. CPU tests: descriptor_increment (table, TargetView payload, invalid type) and descriptor_handles (slot math, overflow, dirty ranges, a copy between two heaps). ctest 17/17 and d3d12_vulkan_device_test/d3d12_com_test pass on an RTX 5080.
|
Tested b9c6b61 (merged on current main 8bd0087) on RTX 3090, driver 616.56, Windows 11: fail.
Cause: in #334 contains this commit and fails the same line (checked at 542d5f6). AI-assisted test run and analysis; synthetic tests only, no game files. |
|
Tested b9c6b61 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44:
Cause: in Passing No game files used. AI-assisted run (Claude Code). |
Why
GetDescriptorHandleIncrementSizereturned one constant for every heap type, a heap had no stride of its own, andCopyDescriptors/CopyDescriptorsSimplewalked handles with that constant. A sampler, RTV/DSV and CBV/SRV/UAV heapare allowed to diverge, and a CPU handle that leaves its heap could be copied from arbitrary memory.
What
runtime/src/descriptor_sizes.h: per-type slot table (T# 32 B, S# 32 B, RTV/DSV 32 B, unknown type 0).CreateDescriptorHeaprejects a type with no slot size;GetDescriptorHandleIncrementSizeanswers per type.DescriptorHeapkeeps its own stride, slot count and base, registers inDeviceState, unregisters on destruction.runtime/src/descriptor_handles.h:slot_index,slot_run_bytes,DirtyRange/merge,copy_slots_between.CopyDescriptors/CopyDescriptorsSimpleresolve both heaps from the registry, copy with the destination heap'sstride, clamp to the heap, and mark the copied slots dirty for the bindless scan.
Tests
descriptor_incrementanddescriptor_handles(CPU, no Vulkan, no game data), including a copy between twodistinct heaps.
ctest: 20/20.d3d12_vulkan_device_testandd3d12_com_testpass on an RTX 5080 Laptop (621.14).Follow-up to #230, which kept the single constant; tracked in #156.