Translator: the coverage after the depth tests is refused on every device; its lowering goes

[[sample_mask, post_depth_coverage]] read SampleMask under the PostDepthCoverage execution mode
where a profile enabled VK_EXT_post_depth_coverage, and was refused as needing the extension
elsewhere. The runtime never enables the extension, so it refused every such function all along,
and nothing ever executed the lowering: no test runs it, and the golden tables only compile it.
It goes to a typed refusal, Unsupported::not_implemented(Feature::PostDepthCoverage), at the
parameter's plan; the IR's ExecMode::PostDepthCoverage goes with its builder, serializer and
requirement arms, and the enable-set facts class the extension as described and never enabled.
The AIR decode of the parameter (Builtin::PostDepthCoverage) and the SPIR-V and Vulkan
vocabulary stay, the decode being what the refusal reads.

The refusal moves from a device's to ours: Feature::PostDepthCoverage's doc, its reach mark and
docs/REFUSALS.md (regenerated) say every device. The runtime README's known gaps of render
pipeline states gain its line: refused on every device, built on the extension with its tests if
a guest meets it.

Class 3 of the planner's rule (a sole lowering under 150 lines that nothing executes). No public
item goes (signatures.py --check clean). The consumer's checkout (reims-vgpu at bd9d6ae85a)
names it once, Metal's supportsPostDepthCoverage in a guest test's protocol member list, not an
item of ours. Product lines: +15 -34. The golden tables' pdc_after rows move from compiled to
refused on the profiles that enabled the extension (re-stamped at the pin); no SEMANTICS bump
(the refusal changes no module that compiles).
This commit is contained in:
Anees Iqbal committed 2026-11-22 00:17:21 -08:00
1 parent 22d32fc372
commit 3d8e01d2c2
11 files changed
+24 -37

No files matched your search

+6
View File
@@ -3395,6 +3395,12 @@ cache is answered compile-required on both.
`Error::Translation` naming `RasterOrderGroups` and `fragmentShaderPixelInterlock`. Of the venues
run, KosmicKrisp on the M3 Max and RADV on the RX 550 list neither the extension nor the feature
(vulkaninfo, jobs m3-max-61291 and m3-max-61296).
- A fragment function that reads `[[sample_mask, post_depth_coverage]]`, the coverage after the
early depth and stencil tests, is refused at creation on every device, an `Error::Translation`
naming `PostDepthCoverage` (`NotImplemented`). Vulkan's one form for it is
`VK_EXT_post_depth_coverage`, which the floor does not enable, and the translator keeps no
lowering for it. The runtime has refused it on every device all along, worded before as the
extension the device lacked. If a guest meets it, it is built on that extension, with its tests.
- The depth clip mode `Clamp` and the triangle fill mode `Lines`, which Vulkan 1.3 bakes into a
`VkPipeline`, are each a `VkPipeline` of the draw's class that a content's first draw under them
makes, which Metal does not: that draw waits for it (`Metrics::first_use_raster_waits`).
+3 -1
View File
@@ -355,7 +355,6 @@ fn facts(ext: VkExtension) -> ExtensionFacts {
| E::ExtMultiDraw
| E::ExtAttachmentFeedbackLoopLayout
| E::ExtExtendedDynamicState3
| E::ExtPostDepthCoverage
| E::ImgFormatPvrtc
| E::KhrPortabilitySubset
| E::ExtShaderAtomicFloat => fact(true, None, &[]),
@@ -400,6 +399,9 @@ fn facts(ext: VkExtension) -> ExtensionFacts {
// Described, never enabled: a float fma is the device's `Fma` on every device
// (`lower::arith::fma`), so the core reads none of its features.
E::KhrShaderFma => fact(false, None, &[]),
// Described, never enabled: the coverage after the depth and stencil tests is refused on
// every device (`Feature::PostDepthCoverage`), so the core reads none of it.
E::ExtPostDepthCoverage => fact(false, None, &[]),
E::KhrDynamicRendering => fact(false, Some(3), &[]),
// Object and mesh functions. `VK_KHR_spirv_1_4` is core at the 1.2 floor.
E::ExtMeshShader => fact(true, None, &[]),
@@ -492,7 +492,8 @@ pub enum VkExtension {
/// [`VkProperty::ProvokingVertexModePerPipeline`].
ExtProvokingVertex,
/// `VK_EXT_post_depth_coverage` (never promoted, no feature member): a fragment shader's
/// `SampleMask` input read after the early depth and stencil tests (`PostDepthCoverage`).
/// `SampleMask` input read after the early depth and stencil tests. The translator reads it
/// nowhere: `Feature::PostDepthCoverage` is refused on every device.
ExtPostDepthCoverage,
// Appended.
/// `VK_EXT_line_rasterization` (promoted to `VK_KHR_line_rasterization`, never core):
+3 -2
View File
@@ -898,8 +898,9 @@ pub enum Feature {
/// buffer's other such fences the translation keeps through an atomic of the command buffer's
/// `ExecutionStatus` word: in a vertex or fragment stage without its stores and atomics.
SeqCstFence,
/// The coverage after the depth and stencil tests (`[[sample_mask, post_depth_coverage]]`),
/// read through `VK_EXT_post_depth_coverage`.
/// The coverage after the depth and stencil tests (`[[sample_mask, post_depth_coverage]]`).
/// Vulkan's one form reads `SampleMask` under `VK_EXT_post_depth_coverage`, which no runtime
/// enables; no form is built.
PostDepthCoverage,
/// Lines at a width other than 1 (Apple's `setLineWidth:`), drawn by the device's own wide
/// lines (`wideLines`) or as bands of triangles through synthesized tessellation stages
+7 -20
View File
@@ -913,27 +913,16 @@ pub fn param(cx: &mut SelectCx<'_>, b: &ParamBinding) -> Result<(), Error> {
)
.into());
}
// `[[sample_mask, post_depth_coverage]]`: Vulkan's one form, `SampleMask` read under
// `VK_EXT_post_depth_coverage`, is an extension no runtime enables, and no other form is
// built.
(ParamRole::Builtin(Builtin::PostDepthCoverage), _) => {
return Err(Unsupported::not_implemented(Feature::PostDepthCoverage).into());
}
(ParamRole::Builtin(bi), _) => {
refuse_int64_interface(cx.entry, ty)?;
let f = form_on(cx.entry, cx.profile, ty)?;
let (spirv, shape, place, contract, enabler) = input_builtin(cx, *bi, f, frag)?;
// `[[sample_mask, post_depth_coverage]]`: `SampleMask` read after the early depth and
// stencil tests, which the entry declares (the AIR decode requires them), through
// `VK_EXT_post_depth_coverage`.
if *bi == Builtin::PostDepthCoverage {
let ext = VkExtension::ExtPostDepthCoverage;
if !cx.profile.fields().enabled.extensions.contains(&ext) {
return Err(Unsupported::needs(
Feature::PostDepthCoverage,
Capability::Extension(ext),
)
.into());
}
let modes = &mut cx.families.stage_io.modes;
if !modes.contains(&ExecMode::PostDepthCoverage) {
modes.push(ExecMode::PostDepthCoverage);
}
}
if matches!(
contract,
StageBuiltin::BaseVertex | StageBuiltin::BaseInstance
@@ -1862,9 +1851,7 @@ fn input_builtin(
None,
)
}
// The coverage after the early tests reads the same builtin under `PostDepthCoverage`
// (the entry's mode, `ParamRole::Builtin` in `plan`).
Bi::SampleMaskIn | Bi::PostDepthCoverage if !vertex => {
Bi::SampleMaskIn if !vertex => {
int_scalar(f)?;
(
B::SampleMask,
@@ -1445,7 +1445,6 @@ fn mode_contract(m: ExecMode) -> (u8, Option<u8>, &'static [ExecModel]) {
(18, None, MESH)
}
ExecMode::RequireFullQuads => (19, None, FRAG),
ExecMode::PostDepthCoverage => (21, None, FRAG),
}
}
@@ -1343,9 +1343,6 @@ pub enum ExecMode {
/// `RequireFullQuadsKHR` (`SPV_KHR_quad_control`, fragment only): every quad starts with its
/// four invocations, helpers included, and they take part in every group operation.
RequireFullQuads,
/// `PostDepthCoverage` (`SPV_KHR_post_depth_coverage`, fragment only): `SampleMask` reads the
/// coverage after the early depth and stencil tests.
PostDepthCoverage,
// ---- Tessellation ----
/// The triangle patch domain.
Triangles,
@@ -876,11 +876,6 @@ impl Deriver<'_> {
self.ext(SpirvExtension::KhrQuadControl);
self.feat(VkFeature::ShaderQuadControl);
}
ExecMode::PostDepthCoverage => {
self.cap(Cap::SampleMaskPostDepthCoverage);
self.ext(SpirvExtension::KhrPostDepthCoverage);
self.r.extensions.insert(VkExtension::ExtPostDepthCoverage);
}
// A task or mesh entry's local size is bounded by the mesh shader limits, which no
// profile records yet: the stage's feature, which none enables, refuses it first.
ExecMode::LocalSize { x, y, z } if self.model == ExecModel::GLCompute => {
@@ -999,7 +999,6 @@ impl Ser<'_> {
ExecMode::SubgroupUniformControlFlow => plain(w, M::SubgroupUniformControlFlowKHR, &[]),
ExecMode::MaximallyReconverges => plain(w, M::MaximallyReconvergesKHR, &[]),
ExecMode::RequireFullQuads => plain(w, M::RequireFullQuadsKHR, &[]),
ExecMode::PostDepthCoverage => plain(w, M::PostDepthCoverage, &[]),
ExecMode::Triangles => plain(w, M::Triangles, &[]),
ExecMode::Quads => plain(w, M::Quads, &[]),
ExecMode::SpacingEqual => plain(w, M::SpacingEqual, &[]),
+2 -2
View File
@@ -40,7 +40,7 @@ Columns:
| Kind | `metal-measured` | `metal-documented` | `metal-takes` | `device` | `ours` | `unknown` | `delegated` | `-` |
|---|---|---|---|---|---|---|---|---|
| Translator and front-end refusals | 0 | 0 | 0 | 51 | 68 | 0 | 0 | 0 |
| Translator and front-end refusals | 0 | 0 | 0 | 50 | 69 | 0 | 0 | 0 |
| Binder refusals at a device limit | 0 | 0 | 0 | 9 | 0 | 0 | 0 | 0 |
| Translation caps | 0 | 0 | 0 | 0 | 14 | 0 | 0 | 0 |
| Rate maps the compile layer does not compile | 0 | 0 | 0 | 0 | 5 | 0 | 0 | 0 |
@@ -171,7 +171,7 @@ Columns:
| `ProgramScopeBinding` | A program-scope buffer binding of MSL 3.2 (macOS 15 and later), `constant T* constant p [[buffer(n)]];` in Apple's `!air.global_bindings` list,... | every device (not implemented) | `ours` | via a helper: 2: `crates/metal2vulkan-air/src/abi/module.rs (decode)`, `crates/metal2vulkan/src/error/mod.rs (from)` | `app`: MSL 3.2 program-scope buffer bindings (macOS 15 and later) |
| `GenericPointer` | A generic pointer (MSL 4.1's `addrspace(8)`) that canonicalization cannot make a pointer of one address space, by how it comes to hold a space... | every device (not implemented) | `ours` | 2: `crates/metal2vulkan-air/src/canon/generic.rs (refuse)`, `crates/metal2vulkan-air/src/canon/generic.rs (refused)` | `system`: MSL 4.1 generic pointers held in memory or of two spaces (macOS 27 and later) |
| `SeqCstFence` | A sequentially consistent fence (`seq_cst` `atomic_thread_fence`, an LLVM `fence seq_cst`, or a `seq_cst` barrier ordering device memory), whose... | devices short of a Vulkan feature the site names | `device` | 1: `crates/metal2vulkan/src/lower/sync/barrier.rs (require_seq_cst)` | `rare`: a seq_cst fence in a vertex or fragment stage without its stores and atomics |
| `PostDepthCoverage` | The coverage after the depth and stencil tests (`[[sample_mask, post_depth_coverage]]`), read through `VK_EXT_post_depth_coverage` | devices short of a Vulkan extension the site names | `device` | 1: `crates/metal2vulkan/src/lower/stage_io/plan.rs (param)` | `rare`: the coverage after early depth and stencil tests on a device without VK_EXT_post_depth_coverage |
| `PostDepthCoverage` | The coverage after the depth and stencil tests (`[[sample_mask, post_depth_coverage]]`) | every device (not implemented) | `ours` | 1: `crates/metal2vulkan/src/lower/stage_io/plan.rs (param)` | `rare`: the coverage after early depth and stencil tests, on every device |
| `WideLines` | Lines at a width other than 1 (Apple's `setLineWidth:`), drawn by the device's own wide lines (`wideLines`) or as bands of triangles through... | devices without VkFeature::TessellationShader; devices without VkLimit::MaxTessellationEvaluationOutputComponents; every device (not implemented) | `ours` | 3: `crates/metal2vulkan/src/pipeline/link/band.rs (plan, 3 sites)` | `none`: a line under the Apple-private setLineWidth: at a width other than 1 drawn as the band, whose pipeline form the translator does not build (a selected slice or viewport, barycentric weights, multiview, synthesized geometry, too many stage outputs) |
## 2. Binder refusals at a device limit (`BindError`)
+1 -1
View File
@@ -110,7 +110,7 @@ feature DepthBiasClamp app depth bias clamp on a device without depthBiasClamp
feature ConstantAlphaBlendFactor app blend-alpha factors on a portability-subset device without them
feature SparseTexture rare sparse residency reads
feature TextureSwizzle app texture swizzles whose Metal behaviour is unmeasured
feature PostDepthCoverage rare the coverage after early depth and stencil tests on a device without VK_EXT_post_depth_coverage
feature PostDepthCoverage rare the coverage after early depth and stencil tests, on every device
feature PrivateMemory rare very large per-thread arrays
feature Reflection rare reflection of argument kinds Metal's answer is unmeasured for
feature ViewportDepthRange rare viewport depth outside [0, 1]
Can't render this file because it contains an unexpected character in line 17 and column 65.