Commit 25f1b83
committed
Reflect SPV_EXT_descriptor_heap heap accesses per entry point
Parses the SPV_EXT_descriptor_heap and SPV_KHR_untyped_pointers opcodes
that Slang and DXC emit for bindless descriptor-heap access, and
surfaces the result per entry point as two new arrays on
SpvReflectEntryPoint:
resource_heap_accesses[] -- one entry per distinct
(heap variable, OpTypeRuntimeArray) pair reached from the entry
point's static call graph, classified into a Vulkan descriptor
type (sampled image, storage image, uniform/storage texel buffer,
uniform/storage buffer, acceleration structure).
sampler_heap_accesses[] -- same shape for the sampler heap.
Each entry records the heap variable name, the runtime-array type id,
the array stride (UINT32_MAX when the stride is supplied at runtime via
OpConstantSizeOfEXT rather than as a literal), the descriptor type, and
a pointer to the concrete struct type description when the slot is a
StructuredBuffer/ConstantBuffer reinterpreted through OpBufferPointerEXT.
Parser additions in spirv_reflect.c:
- OpUntypedVariableKHR with the ResourceHeapEXT / SamplerHeapEXT
builtins is recognised as a heap-root variable.
- OpUntypedAccessChainKHR rooted at one of those variables is the
point of access; result ids are now captured so downstream opcodes
can match against them.
- OpTypeBufferEXT is a recognised type whose StorageClass operand
drives uniform-buffer vs storage-buffer descriptor classification.
- OpBufferPointerEXT is followed at the access site to recover the
concrete struct type used when the heap slot is the opaque buffer
descriptor placeholder.
- OpConstantSizeOfEXT no longer poisons the constant table; its
driver-supplied value is treated as unknown.
- ArrayStrideIdEXT resolves its constant operand to a literal stride
when the operand is OpConstant, falling back to UINT32_MAX when it
is OpConstantSizeOfEXT.
YAML emission in common/output_stream.cpp grows an
entry_point_heap_accesses block to expose the new arrays.
Out of scope for this change: per-resource enumeration of which heap
indices are touched, OpUntypedImageTexelPointerEXT, OpMemberDecorateIdEXT,
OffsetIdEXT, and a Pointer-style follow-up of OpUntypedAccessChainKHR
through the existing access-chain machinery.
Companion test fixtures and golden YAMLs are added in the parent PR.1 parent 3923cd7 commit 25f1b83
3 files changed
Lines changed: 511 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
1669 | 1735 | | |
1670 | 1736 | | |
1671 | 1737 | | |
| |||
2217 | 2283 | | |
2218 | 2284 | | |
2219 | 2285 | | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
2220 | 2303 | | |
2221 | 2304 | | |
2222 | 2305 | | |
| |||
2328 | 2411 | | |
2329 | 2412 | | |
2330 | 2413 | | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
2331 | 2450 | | |
2332 | 2451 | | |
2333 | 2452 | | |
| |||
0 commit comments