Commit 7abbb35
committed
Add LayoutContext, pointer types, non-struct pseudo-member, opaque type handling
Refactor block layout validation to use a LayoutContext struct that
threads module, definitions, pointer_size, and capabilities through
all layout calculation functions. This replaces individual parameter
passing and enables proper capability-based handling of special types.
- Add LayoutContext struct matching C++ ValidationState_t threading
- Add compute_pointer_size() from addressing model (Physical32 → 4,
Physical64/PhysicalStorageBuffer64 → 8, Logical → 0)
- Add pointer type handling in type_alignment and type_layout_size
(returns None for logical addressing, matching C++ behavior)
- Add non-struct pseudo-member path in check_struct_layout for
PhysicalStorageBuffer pointers (C++ checkLayout lines 498-507)
- Add opaque type (image/sampler) handling with capability checks
(BindlessTextureNV → needs samplerimage_variable_address_mode,
DescriptorHeapEXT → not in rspirv yet, both skip gracefully)
- Add 6 new tests: pointer member under logical/physical addressing,
pointer alignment validation, pointer overlap detection,
non-struct type layout pass-through1 parent 6a1e259 commit 7abbb35
2 files changed
Lines changed: 374 additions & 75 deletions
0 commit comments