Files
metal2vulkan/docs
Anees Iqbal 23d6572c18 Push placement: a post-tessellation vertex function's window starts past the control stage's range
A tessellation render pipeline whose vertex and fragment functions' push fields filled the
floor's 256 bytes was refused at link ("unsupported: Tessellation; needs AnyOf: Limit
MaxPushConstantsSize, required 260, available 256"): link places the synthesized control stage's
push range (8 to 24 bytes) at the first free offset beside the two functions' ranges, and since
the tail placement (0cd2ad765d: each stage's push ends with its tail, 24 bytes above its other
fields) the pair's ranges can end within 8 bytes of 256. Metal makes the pipeline, and the device
lacks nothing.

The form, one on every device: a post-tessellation vertex function's window is [24, 248) instead
of [0, 248), so the control stage's range, at most control::PUSH_BYTES (24) in either form, is
placed at 0, and the fields the pair cannot push spill into their parameter blocks, the form a
function's fields past its window already take. The tail and its 24-byte hole are unchanged. A
fragment function behind such a vertex function that pushes nothing starts at 24 too.

- lower/push.rs: window(Vertex, base) starts at base; TESSELLATION_BASE (= control::PUSH_BYTES);
  base(cx), the start of a function's fields (24 for a post-tessellation vertex function, else
  LoweringInputs::push_base); fragment_base(), the vertex function's push end or its window's
  start, used by CompiledFunction::fragment_push_base, compile::vertex_push_end and link's
  check_push_base.
- select and access place and census the fields from push::base.
- SEMANTICS_VERSION 2204 (a post-tessellation vertex function's and its fragment function's
  placements move).
- Tests: push.rs pins the vertex window from either start, and that the control stage's range in
  every form (bound and address, each factor step, scale on and off) fits below 24 and a
  fragment base behind an empty post-tessellation placement is 24. rt's
  every_device_draws_patches_whose_fragment_fills_the_push_range: a patch state behind fragment
  functions of 4, 8, 12 and 16 buffers is made, pushes the factors' address at 0, and draws its
  patches with every buffer's bits; the widest pair's fields end past 248.
- Docs: API.md section 5, the rt README's push range, PushPlacement::push_range,
  LoweringInputs::push_base, CompiledFunction::fragment_push_base, the tessellation link docs.

The line band's evaluation stage (16 bytes, WideLines) and the fan-out probe's geometry stage (4
bytes, RasterizationRateMap) are still placed by tessellation::push_offset beside the pair's
ranges and refused where those fill the floor: the same shape, not changed here.
2026-11-20 09:30:12 -08:00
..