Pipeline: behind the agx flag a wider fragment input reads its vertex output's lanes, then zeros
The planner's ruling for the wide case of agx.allow_mismatched_component_counts: Metal
makes a render pipeline whose fragment function reads a varying at more components
than its flagged vertex function writes, and leaves the lanes past the output's
undefined (M3 Max, macOS 27.0.1, job m3-max-87586: 150 such lanes read 147 distinct
values, none written). One form on every device, decided at pipeline make by structure:
- LoweringInputs::widened_varyings (new public field, serde default): the user varyings
a flagged vertex function writes at fewer lanes than the pipeline's fragment function
reads, with the count it reads, of the same AIR scalar type. compile_render_pipeline
and render_variant_key derive it from the two Function stages' specialized entries
(compile.rs widened_varyings: return-struct field types against fragment-input
parameter types), only where the vertex entry carries the flag; a Compiled stage on
either side gives none. render_pipeline compiles the vertex stage, and only where its
StageIo carries the flag and the set is not empty compiles it again under the set;
render_variant_key hands it to the vertex inputs, so a runtime's stage-by-stage
compile under the keys widens too, and the pipeline key matches.
- Planning declares such an output at the read count (StageIo outputs list it so, so
link matches equal types) and marks its object in StageIoPlan::widened; store writes
the value's lanes then a constant 0 per extra lane (OpCompositeConstruct). Colour
outputs, whose declared components may differ from their form for other reasons, are
never marked.
- The key appends the set only when set: every other function keeps its key.
- Link is unchanged: a wider input behind a vertex function compiled alone stays
Unsupported{UnmatchedVarying, NotImplemented}, as does a mesh producer; flag 0 or
absent stays Metal's link error.
Docs: docs/API.md accepted differences gains the line (Metal undefined, we give zeros;
no precision note, per the ruling); the UnmatchedVarying, StageIo and link docs say
where the gap now remains; reach.tsv's line likewise; REFUSALS.md regenerated; the API
signature table blessed (LoweringInputs.widened_varyings); the inputs-encoding and serde
round-trip tests cover the field. SEMANTICS_VERSION stays at 2394 (the narrow
form's bump).
Tests: the red tests of 3f0fa825f4 (jobs m3-max-87655 lavapipe + translator, m3-max-87661
RTX 5080) go green in the jobs named in the READY message.
This commit is contained in:
1 parent
3b921fc5eb
commit
255f758265
17 files changed
+261
-21
No files matched your search
@@ -2789,6 +2789,11 @@ named states the rule in full.
|
||||
27.0.1) refuses it outside the private OpenGL mode with "depthAttachmentPixelFormat is not valid
|
||||
and shader writes to depth" (the probe `metal2vulkan-conformance/probes/opengl_mode.m`), a
|
||||
refusal no Metal document states (`MTLRenderPipeline.h`, `depthAttachmentPixelFormat`).
|
||||
- **A fragment input wider than its vertex output reads 0 in the lanes past the output's**, behind
|
||||
a vertex function whose module states `agx.allow_mismatched_component_counts` as 1
|
||||
(`LoweringInputs::widened_varyings`). Metal makes that pipeline and leaves those lanes
|
||||
undefined: measured on an Apple M3 Max (macOS 27.0.1, job m3-max-87586), 150 such lanes read
|
||||
147 distinct values, none of them written by the function.
|
||||
|
||||
**Resource IDs and identifiers**
|
||||
|
||||
|
||||
Reference in new issue
Block a user