Files
metal2vulkan/scripts/conformance-coverage/metal_enumerators.tsv
T
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

63 lines
4.4 KiB
Plaintext

# Generated from the macOS 27.2 SDK Metal.framework headers (names and values).
# Regenerate with scripts/regen-metal-enums/regen_metal_enums.py; do not edit.
# The SDK's values for the Metal enums and option sets this tree models by hand, which is
# the conformance suite's option-space denominator for them.
type kind role rust enumerator value
MTLBlitOption flags value NONE MTLBlitOptionNone 0
MTLBlitOption flags value DEPTH_FROM_DEPTH_STENCIL MTLBlitOptionDepthFromDepthStencil 1
MTLBlitOption flags value STENCIL_FROM_DEPTH_STENCIL MTLBlitOptionStencilFromDepthStencil 2
MTLBlitOption flags value ROW_LINEAR_PVRTC MTLBlitOptionRowLinearPVRTC 4
MTLCPUCacheMode enum value DefaultCache MTLCPUCacheModeDefaultCache 0
MTLCPUCacheMode enum value WriteCombined MTLCPUCacheModeWriteCombined 1
MTLCommandBufferStatus enum value NotEnqueued MTLCommandBufferStatusNotEnqueued 0
MTLCommandBufferStatus enum value Enqueued MTLCommandBufferStatusEnqueued 1
MTLCommandBufferStatus enum value Committed MTLCommandBufferStatusCommitted 2
MTLCommandBufferStatus enum value Scheduled MTLCommandBufferStatusScheduled 3
MTLCommandBufferStatus enum value Completed MTLCommandBufferStatusCompleted 4
MTLCommandBufferStatus enum value Error MTLCommandBufferStatusError 5
MTLHazardTrackingMode enum value Default MTLHazardTrackingModeDefault 0
MTLHazardTrackingMode enum value Untracked MTLHazardTrackingModeUntracked 1
MTLHazardTrackingMode enum value Tracked MTLHazardTrackingModeTracked 2
MTLHeapType enum value Automatic MTLHeapTypeAutomatic 0
MTLHeapType enum value Placement MTLHeapTypePlacement 1
MTLHeapType enum value Sparse MTLHeapTypeSparse 2
MTLLoadAction enum value DontCare MTLLoadActionDontCare 0
MTLLoadAction enum value Load MTLLoadActionLoad 1
MTLLoadAction enum value Clear MTLLoadActionClear 2
MTLMultisampleDepthResolveFilter enum value Sample0 MTLMultisampleDepthResolveFilterSample0 0
MTLMultisampleDepthResolveFilter enum value Min MTLMultisampleDepthResolveFilterMin 1
MTLMultisampleDepthResolveFilter enum value Max MTLMultisampleDepthResolveFilterMax 2
MTLMultisampleStencilResolveFilter enum value Sample0 MTLMultisampleStencilResolveFilterSample0 0
MTLMultisampleStencilResolveFilter enum value DepthResolvedSample MTLMultisampleStencilResolveFilterDepthResolvedSample 1
MTLPipelineOption flags value NONE MTLPipelineOptionNone 0
MTLPipelineOption flags value ARGUMENT_INFO MTLPipelineOptionArgumentInfo 1
MTLPipelineOption flags value BUFFER_TYPE_INFO MTLPipelineOptionBufferTypeInfo 2
MTLPipelineOption flags value FAIL_ON_BINARY_ARCHIVE_MISS MTLPipelineOptionFailOnBinaryArchiveMiss 4
MTLPipelineOption flags alias ARGUMENT_INFO MTLPipelineOptionBindingInfo 1
MTLPurgeableState enum value KeepCurrent MTLPurgeableStateKeepCurrent 1
MTLPurgeableState enum value NonVolatile MTLPurgeableStateNonVolatile 2
MTLPurgeableState enum value Volatile MTLPurgeableStateVolatile 3
MTLPurgeableState enum value Empty MTLPurgeableStateEmpty 4
MTLSparsePageSize enum value Size16 MTLSparsePageSize16 101
MTLSparsePageSize enum value Size64 MTLSparsePageSize64 102
MTLSparsePageSize enum value Size256 MTLSparsePageSize256 103
MTLSparseTextureRegionAlignmentMode enum value Outward MTLSparseTextureRegionAlignmentModeOutward 0
MTLSparseTextureRegionAlignmentMode enum value Inward MTLSparseTextureRegionAlignmentModeInward 1
MTLStorageMode enum value Shared MTLStorageModeShared 0
MTLStorageMode enum value Managed MTLStorageModeManaged 1
MTLStorageMode enum value Private MTLStorageModePrivate 2
MTLStorageMode enum value Memoryless MTLStorageModeMemoryless 3
MTLStoreAction enum value DontCare MTLStoreActionDontCare 0
MTLStoreAction enum value Store MTLStoreActionStore 1
MTLStoreAction enum value MultisampleResolve MTLStoreActionMultisampleResolve 2
MTLStoreAction enum value StoreAndMultisampleResolve MTLStoreActionStoreAndMultisampleResolve 3
MTLStoreAction enum value Unknown MTLStoreActionUnknown 4
MTLStoreAction enum value CustomSampleDepthStore MTLStoreActionCustomSampleDepthStore 5
MTLStoreActionOptions flags value NONE MTLStoreActionOptionNone 0
MTLStoreActionOptions flags value CUSTOM_SAMPLE_POSITIONS MTLStoreActionOptionCustomSamplePositions 1
MTLVisibilityResultMode enum value Disabled MTLVisibilityResultModeDisabled 0
MTLVisibilityResultMode enum value Boolean MTLVisibilityResultModeBoolean 1
MTLVisibilityResultMode enum value Counting MTLVisibilityResultModeCounting 2
MTLVisibilityResultType enum value Reset MTLVisibilityResultTypeReset 0
MTLVisibilityResultType enum value Accumulate MTLVisibilityResultTypeAccumulate 1