Files
Anees Iqbal 61a9508e92 Build visibilityResultType: Accumulate takes a pass's results into the buffer's words
RenderPassDescriptor gains visibility_result_type (MTLVisibilityResultType: Reset, the default
and today's behaviour, and Accumulate). Under Accumulate no query result is copied over its
offset's word: every query of an offset, the first one too, is copied into the upload region the
continuations already use, and the crate-owned combine takes them into the word as the buffer
holds it. The combine already loaded the destination word as its accumulator, so Accumulate is
the first query becoming one more source. A `Boolean` word ORs the device's results in; a
`Counting` word is summed in through a new table mode of the combine, into the word's low 32 bits
alone, wrapping there, its high 32 bits kept (ContinuedResult::low_half / in_low_half). That last
part is what the M3 Max answered when recorded: 0xffff_fff8 plus 16 samples writes 8, and
0xffff_ffff_ffff_fff8 plus 16 writes 0xffff_ffff_0000_0008. A plain 64-bit sum was divergent there.
An offset set with no draw after it keeps its word, because a query with no draw adds 0. Where a
no-copy buffer's bytes start off a multiple of 8, so the results land in an upload region, the
words are now copied into that region before the combine (Landing::inward). Reset records exactly
what it did before.

Conformance: RenderPass gains visibility_type (typed()), and words() appends it only where it is
not Reset, so existing fingerprints read as before. Both sides set it. There are four new
visibility cases, recorded on the M3 Max (macOS 27.0.1): visibility-counting-accumulate (two
command buffers; words 100/5/7/0xffff_fff8/u64::MAX-7), visibility-counting-accumulate-one-command-buffer
(two passes in one command buffer, read once), visibility-counting-accumulate-revisit, and
visibility-boolean-accumulate (words 0/2/3 under covering and non-covering draws, an offset set
with no draw, then a second command buffer). The family's acts key states the type, and a joined
shape adds a command-buffer input. Cost and timing records for the new cases are not written here.

Lane tests (runtime_lane): accumulated_counts_add_to_the_words,
accumulated_booleans_or_into_the_words, and
host_bytes::accumulated_visibility_results_land_where_their_bytes_lie. Unit tests: the combine's
accumulated_counts_are_summed_into_the_low_half, its plan's table mode, and the type's raw values.

Coverage: coverage.tsv marks MTLRenderPassDescriptor.visibilityResultType implemented (its unused
"visibility" group is removed), and METAL-COVERAGE.md is regenerated. MTLVisibilityResultType joins
the enum table, so metal_enumerators.tsv and CONFORMANCE-COVERAGE.md are regenerated. The API
signatures are re-blessed. REFUSALS.md is regenerated: VisibilityResultType::from_raw is one more
UndefinedValue site. The regeneration also picks up two bind/graphics.rs sites the committed file
was missing. The degrade docs (landed results, Boolean) state Accumulate.

Verified on the M3 Max under MoltenVK 1.4.2:
- The 52 visibility-touching lane tests pass: visibility, host_bytes, depth_never, amplified_draws,
  degrade_notices and the framebuffer_fetch split pass.
- The visibility family's replay is all announced (no divergence), after the low-half change.
- Negative control with Accumulate forced to Reset: all three Accumulate lane tests fail, and all
  four new cases replay divergent.
- Negative control with no inward copy: the landing test fails at 4 bytes past a page (2 read 0,
  100 read 16).
- Before the low-half change, visibility-counting-accumulate replayed divergent at words 3 and 4.
- The combine's low-half test fails on the interpreter without the high-half select ([8, 1] for
  [8, 0]).
clippy (plain and --cfg m2v_gpu), rustdoc and scripts/api-docs are clean.

SEMANTICS_VERSION: no translated shader changes, but the owned combine module's words do
(main's call). RUNTIME_VERSION and the runtime-sources pin are not touched here.

(cherry picked from commit 1c172968ad6492cebcae2a568fc99e90565d4d11)
(cherry picked from commit 9f47ebcf006920f7561a16a77f77e422de7201c1)
2026-11-03 11:08:01 -08:00

4.4 KiB

1# Generated from the macOS 27.2 SDK Metal.framework headers (names and values).
2# Regenerate with scripts/regen-metal-enums/regen_metal_enums.py; do not edit.
3# The SDK's values for the Metal enums and option sets this tree models by hand, which is
4# the conformance suite's option-space denominator for them.
5typekindrolerustenumeratorvalue
6MTLBlitOptionflagsvalueNONEMTLBlitOptionNone0
7MTLBlitOptionflagsvalueDEPTH_FROM_DEPTH_STENCILMTLBlitOptionDepthFromDepthStencil1
8MTLBlitOptionflagsvalueSTENCIL_FROM_DEPTH_STENCILMTLBlitOptionStencilFromDepthStencil2
9MTLBlitOptionflagsvalueROW_LINEAR_PVRTCMTLBlitOptionRowLinearPVRTC4
10MTLCPUCacheModeenumvalueDefaultCacheMTLCPUCacheModeDefaultCache0
11MTLCPUCacheModeenumvalueWriteCombinedMTLCPUCacheModeWriteCombined1
12MTLCommandBufferStatusenumvalueNotEnqueuedMTLCommandBufferStatusNotEnqueued0
13MTLCommandBufferStatusenumvalueEnqueuedMTLCommandBufferStatusEnqueued1
14MTLCommandBufferStatusenumvalueCommittedMTLCommandBufferStatusCommitted2
15MTLCommandBufferStatusenumvalueScheduledMTLCommandBufferStatusScheduled3
16MTLCommandBufferStatusenumvalueCompletedMTLCommandBufferStatusCompleted4
17MTLCommandBufferStatusenumvalueErrorMTLCommandBufferStatusError5
18MTLHazardTrackingModeenumvalueDefaultMTLHazardTrackingModeDefault0
19MTLHazardTrackingModeenumvalueUntrackedMTLHazardTrackingModeUntracked1
20MTLHazardTrackingModeenumvalueTrackedMTLHazardTrackingModeTracked2
21MTLHeapTypeenumvalueAutomaticMTLHeapTypeAutomatic0
22MTLHeapTypeenumvaluePlacementMTLHeapTypePlacement1
23MTLHeapTypeenumvalueSparseMTLHeapTypeSparse2
24MTLLoadActionenumvalueDontCareMTLLoadActionDontCare0
25MTLLoadActionenumvalueLoadMTLLoadActionLoad1
26MTLLoadActionenumvalueClearMTLLoadActionClear2
27MTLMultisampleDepthResolveFilterenumvalueSample0MTLMultisampleDepthResolveFilterSample00
28MTLMultisampleDepthResolveFilterenumvalueMinMTLMultisampleDepthResolveFilterMin1
29MTLMultisampleDepthResolveFilterenumvalueMaxMTLMultisampleDepthResolveFilterMax2
30MTLMultisampleStencilResolveFilterenumvalueSample0MTLMultisampleStencilResolveFilterSample00
31MTLMultisampleStencilResolveFilterenumvalueDepthResolvedSampleMTLMultisampleStencilResolveFilterDepthResolvedSample1
32MTLPipelineOptionflagsvalueNONEMTLPipelineOptionNone0
33MTLPipelineOptionflagsvalueARGUMENT_INFOMTLPipelineOptionArgumentInfo1
34MTLPipelineOptionflagsvalueBUFFER_TYPE_INFOMTLPipelineOptionBufferTypeInfo2
35MTLPipelineOptionflagsvalueFAIL_ON_BINARY_ARCHIVE_MISSMTLPipelineOptionFailOnBinaryArchiveMiss4
36MTLPipelineOptionflagsaliasARGUMENT_INFOMTLPipelineOptionBindingInfo1
37MTLPurgeableStateenumvalueKeepCurrentMTLPurgeableStateKeepCurrent1
38MTLPurgeableStateenumvalueNonVolatileMTLPurgeableStateNonVolatile2
39MTLPurgeableStateenumvalueVolatileMTLPurgeableStateVolatile3
40MTLPurgeableStateenumvalueEmptyMTLPurgeableStateEmpty4
41MTLSparsePageSizeenumvalueSize16MTLSparsePageSize16101
42MTLSparsePageSizeenumvalueSize64MTLSparsePageSize64102
43MTLSparsePageSizeenumvalueSize256MTLSparsePageSize256103
44MTLSparseTextureRegionAlignmentModeenumvalueOutwardMTLSparseTextureRegionAlignmentModeOutward0
45MTLSparseTextureRegionAlignmentModeenumvalueInwardMTLSparseTextureRegionAlignmentModeInward1
46MTLStorageModeenumvalueSharedMTLStorageModeShared0
47MTLStorageModeenumvalueManagedMTLStorageModeManaged1
48MTLStorageModeenumvaluePrivateMTLStorageModePrivate2
49MTLStorageModeenumvalueMemorylessMTLStorageModeMemoryless3
50MTLStoreActionenumvalueDontCareMTLStoreActionDontCare0
51MTLStoreActionenumvalueStoreMTLStoreActionStore1
52MTLStoreActionenumvalueMultisampleResolveMTLStoreActionMultisampleResolve2
53MTLStoreActionenumvalueStoreAndMultisampleResolveMTLStoreActionStoreAndMultisampleResolve3
54MTLStoreActionenumvalueUnknownMTLStoreActionUnknown4
55MTLStoreActionenumvalueCustomSampleDepthStoreMTLStoreActionCustomSampleDepthStore5
56MTLStoreActionOptionsflagsvalueNONEMTLStoreActionOptionNone0
57MTLStoreActionOptionsflagsvalueCUSTOM_SAMPLE_POSITIONSMTLStoreActionOptionCustomSamplePositions1
58MTLVisibilityResultModeenumvalueDisabledMTLVisibilityResultModeDisabled0
59MTLVisibilityResultModeenumvalueBooleanMTLVisibilityResultModeBoolean1
60MTLVisibilityResultModeenumvalueCountingMTLVisibilityResultModeCounting2
61MTLVisibilityResultTypeenumvalueResetMTLVisibilityResultTypeReset0
62MTLVisibilityResultTypeenumvalueAccumulateMTLVisibilityResultTypeAccumulate1