rt: layered rendering in one form, the vertex function storing Layer in every pass

`RenderPassDescriptor::render_target_array_length` is Metal's `renderTargetArrayLength`. A pass
of length N of 2 or more is one rendering of `layerCount` N: every attachment and resolve texture
is a view of its level and N slices from its own `slice` (a 2D array view; a cube's faces are its
slices), and the rendering's load, store and resolve cover every layer, with no per-layer loop.
At 0 and 1 the pass renders the attachment's slice alone, as Metal's does.

A vertex function's `[[render_target_array_index]]` has one form: the variant that writes
`Layer`, in every pass. Each draw pushes the pass's length, max(len, 1)
(`FieldValue::RenderTargetArrayLength` for the translator's `PushField::RenderTargetArrayLength`),
and the function stores 0 for an index at or past it, so at 0 and 1 every index renders the
attachment's slice. The fragment function reads the raw index through the flat varying the
translator carries. The runtime never asks for `VariantKey::dropped_vertex_layer`; a state whose
fact is `RenderTargetArrayLength { layer_dropped: true }` is refused as a draw input. What still
uses `dropped_vertex_layer`: the old binder (`bind/graphics.rs:905`, the variant it asks for at a
shape's length), stage_io's plan (`lower/stage_io/plan.rs:1600` and `:2305`, also the
non-layered amplification), and the validation crate's engine tests
(`candidate/engine/graphics/tests.rs:907`); it stays for cutxlate to delete.

`shaderOutputLayer` joins the floor's required features: every probed device reports it
(vulkaninfo, jobs m3-max-61359 on gem10: the 780M, the RX 550 and lavapipe; 61360 on um790: the
RX 7900 XTX, the RTX 2080, the 780M and lavapipe; 61361 on um870: the 780M, the RTX 3090 and
lavapipe; 61362: KosmicKrisp, Mesa 26.3.1; 61366: the UHD 630's Windows driver, Vulkan
1.3.215). A device without it gets the floor's refusal. The runtime-floor profile and its
generator gain it.

Refused, in the README's layered-rendering gap line: an attachment or resolve texture with fewer
slices from its own than the pass's length (`Refusal::AttachmentPlace`, naming the last slice); a
3D texture's depth planes (`TextureType`, as for every 3D attachment); a length past
`maxFramebufferLayers` (`RenderPassKind::ArrayLength`, new:
VUID-VkRenderingInfo-layerCount-07817); a draw that reads one of a layered pass's attachments
through a texture on a device without the feedback loop (`AttachmentRead`: a shadow holds one
layer); and a vertex function whose index the translator cannot show the same at every vertex of
a primitive, at creation, naming `LayeredRendering` and `geometryShader`: Vulkan requires one
`Layer` per primitive (VUID-VkPipelineShaderStageCreateInfo-stage-02596), the translator's other
form is a geometry stage device creation does not enable, and Metal calls a differing index
undefined. The feedback-loop move's ranges around the rendered layers (`around`) take the
attachment's layer count.

The conformance runtime side passes the length; the case `layered-render-target-array-length`
loses its ledger row. REFUSALS, METAL-COVERAGE and CONFORMANCE-COVERAGE regenerated; the API
table gains the field and the kind.

Test: `tests::layered`, on every device of the cfg's kind: a 2D array's slices 1 to 3 with an
index past the length, a cube's six faces, a pass of length 0 and one of length 1 whose vertex
function writes index 3 (rendering the attachment's slice, the fragment reading 3), every slice
read back; and `rt6_first_vertex`'s per-vertex index refused naming `LayeredRendering`.
This commit is contained in:
Anees Iqbal committed 2026-11-20 21:11:36 -08:00
1 parent 3ddca91746
commit 4e3a6a3555
22 files changed
+514 -149

No files matched your search

@@ -1205,7 +1205,6 @@ half-texel-nans-rgb9e5f RX 550 divergent case/words/nearest-sample 384 elements
half-texel-nans-rgb9e5f RX 550 divergent case/words/read 384 elements differ (U16), the largest difference 511 The device's own answer (rule 1): a shared-exponent (`RGB9E5Float`) texel's channel below half's normal range through a `half` `read()` of a read-access texture. Metal hands back a `half` denormal (Metal 0x6f at the first differing element); the RX 550 answers zero (ours 0x0). The device has no `shaderFloat16` (the case announced `native-half-quantize`, which only such a device records), so the module rounds the texel's `float`, a normal one, to `half` by the device's `OpQuantizeToF16` and encodes it by `PackHalf2x16`, the 16-bit float form that query chooses; the SPIR-V specification lets the quantize answer zero below half's normal range. Notes `half-texel-conversion`, `native-half-conversion` and `native-half-quantize`.
half-texel-nans-rgb9e5f RX 550 divergent case/words/read-through-sample 384 elements differ (U16), the largest difference 511 The device's own answer (rule 1): a shared-exponent (`RGB9E5Float`) texel's channel below half's normal range through a `half` `read()` of a sample-access texture. Metal hands back a `half` denormal (Metal 0x6f at the first differing element); the RX 550 answers zero (ours 0x0). The device has no `shaderFloat16` (the case announced `native-half-quantize`, which only such a device records), so the module rounds the texel's `float`, a normal one, to `half` by the device's `OpQuantizeToF16` and encodes it by `PackHalf2x16`, the 16-bit float form that query chooses; the SPIR-V specification lets the quantize answer zero below half's normal range. Notes `half-texel-conversion`, `native-half-conversion` and `native-half-quantize`.
half-texel-nans-rgb9e5f RX 550 divergent case/words/widened 384 elements differ (U32), the largest difference 939491328 The device's own answer (rule 1): the shader's `float` widening of the `half` this case read, a shared-exponent texel's channel below half's normal range. Metal widens a `half` denormal (Metal 0x36de0000 at the first differing element); the RX 550's `half` was already zero (ours 0x0): the device has no `shaderFloat16`, and its `OpQuantizeToF16` of the texel's `float`, which the SPIR-V specification lets answer zero below half's normal range, took it there. Notes `native-half-conversion` and `native-half-quantize`.
layered-render-target-array-length * refused case/pipeline:rtal-1/layered/slice-0 Err(Error::Translation("the translator made no pipeline: unsupported: LayeredRendering; needs AnyOf([[Feature(ShaderOutputLayer)], [Feature(GeometryShader)]]) at metadata of entry rt6_layered_vertex")) refused: no stream uses it yet (states-only play 11-19, m3-max-56371-56373, 56375, player 44668b439f: 32 streams, every render and compute pipeline state made). The translator refuses the state (LayeredRendering: a layered render target, which needs shaderOutputLayer or a geometry stage rt does not enable); rt README, Known gaps of pipeline states.
level-sizes-storage * refused case/pipeline Err(Error::Translation("the translator made no pipeline: unsupported: IdentityDomains (an encoder value the function reads as TextureLevels(SlotRef { stage: Kernel, class: Texture, index: 0 })); needs NotImplemented")) refused: no stream uses it yet (states-only play 11-19, m3-max-56371-56373, 56375, player 44668b439f: 32 streams, every render and compute pipeline state made). The translator refuses the state (IdentityDomains: a form the identity domains do not lower); rt README, Known gaps of pipeline states.
math-frexp-ilogb-half 780M divergent case/output/frexp-mantissa 1 element differs (U32): Metal 31745 (0x7c01), ours 32257 (0x7e01) The device's own answer (rule 1): `frexp`'s mantissa of the signalling `half` NaN 0x7c01: Metal keeps its bits; the device answers it quieted (0x7e01). Note `native-nan-encoding`.
math-frexp-ilogb-half RX 7900 XTX divergent case/output/frexp-mantissa 1 element differs (U32): Metal 31745 (0x7c01), ours 32257 (0x7e01) The device's own answer (rule 1): `frexp`'s mantissa of the signalling `half` NaN 0x7c01: Metal keeps its bits; the device answers it quieted (0x7e01). Note `native-nan-encoding`.
Can't render this file because it is too large.
@@ -364,6 +364,7 @@ impl RtSide<'_> {
descriptor.render_target_width = size[0];
descriptor.render_target_height = size[1];
}
descriptor.render_target_array_length = pass.array_length;
for (at, color) in pass.colors.iter().enumerate() {
let Some(held) = color.texture else { continue };
plain(&color.place, color.options)?;
@@ -422,9 +423,6 @@ impl RtSide<'_> {
if let Some(visibility) = pass.visibility {
descriptor.visibility_result_buffer = Some(self.held(visibility)?.clone());
}
if pass.array_length != 0 {
return Err(Failure::unavailable("renderTargetArrayLength"));
}
if !pass.positions.is_empty() {
return Err(Failure::unavailable("setSamplePositions:count:"));
}
+40 -6
View File
@@ -2920,15 +2920,30 @@ or does not check is rebuilt from the generations' names, with young counted ful
into the pass's attachments, and `end_encoding` ends it (`vkCmdEndRendering`): one Vulkan
rendering a Metal render encoder, with no render pass object or framebuffer.
- `RenderPassDescriptor` is `MTLRenderPassDescriptor`: eight color attachments
(`MAX_COLOR_ATTACHMENTS`), a depth and a stencil attachment, `renderTargetWidth` and
`renderTargetHeight`. Each attachment is one level and slice of its texture: a 2D texture, a 2D
(`MAX_COLOR_ATTACHMENTS`), a depth and a stencil attachment, `renderTargetWidth`,
`renderTargetHeight` and `renderTargetArrayLength`. Each attachment is one level of its texture
and, from its `slice`, the pass's layers (below): a 2D texture, a 2D
array, a cube or a cube array, or a 2D multisample texture or array, of `RenderTarget` usage;
every attachment of a pass has one sample count, and a draw's pipeline state that count as its
`rasterSampleCount` (`DrawKind::AttachmentFormats` otherwise). The device's counts are
`Device::supports_texture_sample_count`'s. A multisample attachment is stored as its samples:
a shader reads them through `texture2d_ms` or `depth2d_ms`. The texture keeps an
image view of that level and layer with the identity swizzle, made at the first pass that
renders into it and freed with the texture (`Gauges::attachment_views`).
image view of that level and those layers with the identity swizzle (a 2D view of one layer, a
2D array view of more), made at the first pass that renders into it and freed with the texture
(`Gauges::attachment_views`).
- A pass of `renderTargetArrayLength` N of 2 or more is one rendering of `layerCount` N: every
attachment and every resolve texture renders N slices from its own `slice` (a cube's faces are
its slices), and the rendering's load, store and resolve act on all N, so a layer no draw
reaches carries the pass's clear. At 0 and 1 the pass renders the attachment's slice alone, as
Metal's does. A vertex function's `[[render_target_array_index]]` has one form, in every pass:
it stores `Layer`, its index where that is below the pass's length and 0 at or past it, the
length each draw pushes (`renderTargetArrayLength`, at least 1); so at 0 and 1 every index
renders the attachment's slice, as Metal's does. A fragment function reads the index as the
vertex function wrote it, through a flat varying, so it reads 3 where the vertex function wrote
3 into a pass of one layer. Device creation enables `shaderOutputLayer` (Floor). Metal's rules
(the conformance case `layered-render-target-array-length`, recorded on an Apple M3 Max, macOS
27.0.1): at 0 and 1 the index is ignored, at 2 or more index `i` renders slice `slice + i`, and
the load and store cover every layer.
- Load actions are one to one: `Load`, `Clear` and `DontCare` are Vulkan's load operations of
those names. `Store`, `DontCare` and `Unknown` store: a pass may end its rendering before the
encoder ends and begin it again, loading what it stored (below), so a `DontCare` store keeps the
@@ -3257,12 +3272,30 @@ or does not check is rebuilt from the generations' names, with young counted ful
rendering began resolving, as Vulkan fixes the resolve as it begins), a 1D or 3D texture's
attachment, a 3D resolve texture's plane (`TextureType`), the
`CustomSampleDepthStore` store action, a clear of a format only a shader clears (extended
range, bfloat, YCbCr), and a pass with no attachment. The descriptor has no field for a
range, bfloat, YCbCr), a `renderTargetArrayLength` past the device's `maxFramebufferLayers`
(`ArrayLength`: Vulkan renders at most that many layers,
`VUID-VkRenderingInfo-layerCount-07817`, and requires 256 of it, where Metal's arrays hold 2048
slices), and a pass with no attachment. The descriptor has no field for a
rasterization rate map, tile sizes, imageblock and threadgroup memory, sample buffer
attachments, layered rendering or store action options. The replay
attachments or store action options. The replay
streams' passes render into one or two color attachments and a stencil attachment or a
`Depth32Float` depth attachment, each a level of a 2D texture of one sample, with `Load`,
`Clear` and `DontCare` loads and `Store`, `DontCare` and `Unknown` stores.
- Layered rendering (`renderTargetArrayLength` 2 or more) is refused: for an attachment or a
resolve texture with fewer slices from its own `slice` than the pass's length
(`Refusal::AttachmentPlace`, naming the last slice the pass would render); for a 3D texture's
depth planes, which are no attachment's layers (`Gap::RenderPass`, `TextureType`, as for any 3D
attachment); for a draw that reads one of its pass's attachments through a texture on a device
without the attachment feedback loop (`Gap::Draw`, `AttachmentRead`: an attachment's shadow
holds one layer); and, at creation on every device, for a vertex function whose
`[[render_target_array_index]]` the translator cannot show the same at every vertex of a
primitive, an `Error::Translation` naming `LayeredRendering` and `geometryShader`. Vulkan
requires one `Layer` at every vertex of a primitive
(`VUID-VkPipelineShaderStageCreateInfo-stage-02596`), so such a function cannot store its index
as written; the translator's other form, a generated geometry stage that selects the layer,
needs `geometryShader`, which device creation does not enable; and Metal documents a differing
index as undefined (the Metal Shading Language specification). An index read from a buffer at
the vertex's `[[instance_id]]` is the same at every vertex of a primitive.
- A `Clear` pass of one layer that encodes no draw clears Metal's render area rounded up to 32
pixels a side, where a Mac clears the whole level and slice of a texture it keeps losslessly
compressed, which no Vulkan query tells. A pass whose attachments differ in size reaches the
@@ -3507,6 +3540,7 @@ Presenting runs on the runtime's own device; nothing is exported or imported.
| `shaderClipDistance` | `VkPhysicalDeviceFeatures` | a vertex or post-tessellation vertex function's `[[clip_distance]]` |
| `tessellationShader` | `VkPhysicalDeviceFeatures` | a post-tessellation vertex function's patches, drawn through the device's tessellator |
| `shaderTessellationAndGeometryPointSize` | `VkPhysicalDeviceFeatures` | a post-tessellation vertex function's `[[point_size]]`; without it the device draws every such point at size 1 |
| `shaderOutputLayer` | `VkPhysicalDeviceVulkan12Features` | a vertex function's `[[render_target_array_index]]`, stored to `Layer` in every pass; every venue's driver reports it (RADV on the 780M, the RX 550 and the RX 7900 XTX, NVIDIA's on the RTX 3090 and RTX 2080, lavapipe, KosmicKrisp on the M3 Max, and the UHD 630's Windows driver, a Vulkan 1.3 device; jobs m3-max-61359 to 61362 and 61366) |
| `largePoints` | `VkPhysicalDeviceFeatures` | a draw of points at the `[[point_size]]` its vertex function writes, up to the device's `pointSizeRange`; without it a device draws only points of size 1.0; Vulkan 1.4 and Roadmap 2022 require it |
| `dualSrcBlend` | `VkPhysicalDeviceFeatures` | a fragment function's second output for colour attachment 0 (`[[color(0), index(1)]]`) as the blend's second source (`Source1Color`, `Source1Alpha` and their complements) |
| `sampleRateShading` | `VkPhysicalDeviceFeatures` | a fragment function that reads its `[[sample_id]]`, or an interpolant at a sample, run once per covered sample as Metal runs it; Vulkan 1.4 requires it |
@@ -677,6 +677,7 @@ impl Device {
max_shared_memory: limits.max_compute_shared_memory_size,
max_viewport: limits.max_viewport_dimensions,
viewport_bounds: limits.viewport_bounds_range,
max_framebuffer_layers: limits.max_framebuffer_layers,
};
let max_block_len = vulkan11
.max_memory_allocation_size
@@ -1396,6 +1397,8 @@ pub(crate) struct EncoderLimits {
pub(crate) max_viewport: [u32; 2],
/// `viewportBoundsRange`.
pub(crate) viewport_bounds: [f32; 2],
/// `maxFramebufferLayers`: the most layers a render pass renders (`renderTargetArrayLength`).
pub(crate) max_framebuffer_layers: u32,
}
impl Core {
+2 -1
View File
@@ -1462,7 +1462,8 @@ impl Parameters {
FieldValue::Word(_)
| FieldValue::TessellationFactors
| FieldValue::AlphaTestReference
| FieldValue::FetchedColor(_) => {}
| FieldValue::FetchedColor(_)
| FieldValue::RenderTargetArrayLength => {}
}
}
self.block_address = (interface.block_len > 0).then_some(interface.block_address);
+8 -2
View File
@@ -817,13 +817,15 @@ pub enum Refusal {
/// The attachment's pixel format.
pixel_format: PixelFormat,
},
/// A render pass attachment of a level or slice past its texture's.
/// A render pass attachment or resolve texture of a level or slice past its texture's: its own
/// slice, or the last of the slices a layered pass renders from it
/// (`renderTargetArrayLength`).
///
/// Basis: ours (no texel of the texture is there to render into).
AttachmentPlace {
/// The level asked for.
level: u32,
/// The slice asked for.
/// The slice asked for: the attachment's own, or the last its pass renders.
slice: u32,
},
/// A render pass color attachment of a depth or stencil pixel format, a depth attachment of a
@@ -1555,6 +1557,10 @@ pub enum RenderPassKind {
ClearFormat,
/// A pass with no attachment, its size from `renderTargetWidth` and `renderTargetHeight` alone.
NoAttachment,
/// A `renderTargetArrayLength` past the device's `maxFramebufferLayers`: Vulkan's rendering
/// renders at most that many layers (VUID-VkRenderingInfo-layerCount-07817), and requires 256
/// of it, where Metal's arrays hold 2048 slices.
ArrayLength,
}
/// What a texture view changes that the runtime does not build ([`Gap::TextureView`]).
+4
View File
@@ -443,6 +443,10 @@ pub(crate) const REQUIRED: &[Feature] = &[
// takes. Without it the device draws every such point at size 1. Every floor driver reports
// it.
feature!(core.shader_tessellation_and_geometry_point_size => ShaderTessellationAndGeometryPointSize),
// A vertex function's `[[render_target_array_index]]` in a layered pass: one form, its `Layer`
// output (written 0 for an index at or past the pass's length), in every pass. Every venue's
// driver reports it.
feature!(vulkan12.shader_output_layer => ShaderOutputLayer),
// A point drawn at the size its vertex function writes, up to the device's `pointSizeRange`:
// without it a device draws only points of size 1.0. Vulkan 1.4 and Roadmap 2022 require it
// of every device.
+50 -23
View File
@@ -192,7 +192,8 @@ pub struct RenderPassColorAttachmentDescriptor {
pub texture: Option<Texture>,
/// `level`: the mipmap level rendered into.
pub level: u32,
/// `slice`: the array slice or cube face rendered into.
/// `slice`: the array slice or cube face rendered into, the first of a layered pass's
/// ([`RenderPassDescriptor::render_target_array_length`]).
pub slice: u32,
/// `loadAction`: `DontCare` by default.
pub load_action: LoadAction,
@@ -211,7 +212,8 @@ pub struct RenderPassColorAttachmentDescriptor {
pub resolve_texture: Option<Texture>,
/// `resolveLevel`: the resolve texture's mipmap level resolved into.
pub resolve_level: u32,
/// `resolveSlice`: the resolve texture's array slice or cube face resolved into.
/// `resolveSlice`: the resolve texture's array slice or cube face resolved into, the first of a
/// layered pass's.
pub resolve_slice: u32,
/// `resolveDepthPlane`: a 3D resolve texture's depth plane. A plane but 0 is
/// [`Gap::RenderPass`] of [`RenderPassKind::TextureType`], as a 3D attachment is.
@@ -239,7 +241,8 @@ pub struct RenderPassDepthAttachmentDescriptor {
pub texture: Option<Texture>,
/// `level`: the mipmap level rendered into.
pub level: u32,
/// `slice`: the array slice or cube face rendered into.
/// `slice`: the array slice or cube face rendered into, the first of a layered pass's
/// ([`RenderPassDescriptor::render_target_array_length`]).
pub slice: u32,
/// `loadAction`: `Clear` by default.
pub load_action: LoadAction,
@@ -294,7 +297,8 @@ pub struct RenderPassStencilAttachmentDescriptor {
pub texture: Option<Texture>,
/// `level`: the mipmap level rendered into.
pub level: u32,
/// `slice`: the array slice or cube face rendered into.
/// `slice`: the array slice or cube face rendered into, the first of a layered pass's
/// ([`RenderPassDescriptor::render_target_array_length`]).
pub slice: u32,
/// `loadAction`: `Clear` by default.
pub load_action: LoadAction,
@@ -338,8 +342,8 @@ impl Default for RenderPassStencilAttachmentDescriptor {
/// ([`CommandBuffer::render_command_encoder`](crate::CommandBuffer::render_command_encoder)).
///
/// Not built, and so not fields: a rasterization rate map, tile sizes, imageblock and threadgroup
/// memory lengths, sample buffer attachments, layered rendering (`renderTargetArrayLength`) and a
/// pass with no attachment (`defaultRasterSampleCount`); a pass with no attachment is refused,
/// memory lengths, sample buffer attachments and a pass with no attachment
/// (`defaultRasterSampleCount`); a pass with no attachment is refused,
/// [`Gap::RenderPass`] of [`RenderPassKind::NoAttachment`]. `visibilityResultType` is not a field:
/// it decides only what an enabled visibility result mode writes, and no mode but `Disabled` is
/// built.
@@ -358,6 +362,17 @@ pub struct RenderPassDescriptor {
/// `renderTargetHeight`: where nonzero, the height of Metal's render area, cut to the smallest
/// attachment's, rounded up as the width is for the load, store and resolve.
pub render_target_height: u32,
/// `renderTargetArrayLength`: the layers the pass renders, 0 by default. At 2 or more every
/// attachment and every resolve texture renders that many slices from its own `slice` (a
/// cube's faces are slices), the pass's load, store and resolve act on each of them, and a
/// vertex function's `[[render_target_array_index]]` `i` renders slice `slice + i`, an index at
/// or past the length rendering the first; at 0 and 1 the pass renders the attachment's slice
/// alone, whatever index the vertex function writes, as Metal's does. A fragment function reads
/// the index as the vertex function wrote it. An attachment or resolve texture with fewer
/// slices from its own is refused, [`Refusal::AttachmentPlace`] naming the last slice the pass
/// would render; a length past the device's `maxFramebufferLayers`, [`Gap::RenderPass`] of
/// [`RenderPassKind::ArrayLength`].
pub render_target_array_length: u32,
/// `visibilityResultBuffer`: `None` by default. The command buffer keeps it until it retires,
/// and the pass leaves its bytes as they were: Metal's pass does so under either
/// `visibilityResultType` where its encoder enables no mode (an Apple M3 Max, macOS 27.0.1),
@@ -401,7 +416,7 @@ pub(crate) struct ResolveModes {
}
/// The resolve of an attachment of a checked pass: a view of its resolve texture's level and
/// slice, and the mode Vulkan resolves by.
/// the pass's layers from its slice, and the mode Vulkan resolves by.
pub(crate) struct Resolve {
pub(crate) texture: Texture,
pub(crate) attachment: Attachment,
@@ -417,8 +432,8 @@ impl Resolve {
self.layout != self.attachment.home
}
/// The barrier that moves its level and layer, every aspect, from `old` to `new`, after every
/// earlier command and before every later one.
/// The barrier that moves its level and layers, every aspect, from `old` to `new`, after
/// every earlier command and before every later one.
pub(crate) fn barrier(
&self,
old: vk::ImageLayout,
@@ -429,14 +444,14 @@ impl Resolve {
}
}
/// The level and layer of `a`, every aspect.
/// The level and layers of `a`, every aspect.
fn range(a: &Attachment) -> vk::ImageSubresourceRange {
vk::ImageSubresourceRange {
aspect_mask: a.aspects,
base_mip_level: a.level,
level_count: 1,
base_array_layer: a.layer,
layer_count: 1,
layer_count: a.layers,
}
}
@@ -495,8 +510,8 @@ impl Target {
}
}
/// The barrier that moves its level and layer, every aspect, from `old` to `new`, after every
/// earlier command and before every later one.
/// The barrier that moves its level and layers, every aspect, from `old` to `new`, after
/// every earlier command and before every later one.
pub(crate) fn barrier(
&self,
old: vk::ImageLayout,
@@ -506,7 +521,7 @@ impl Target {
layout_barrier(a.image, self.range(), old, new)
}
/// Its level and layer, every aspect.
/// Its level and layers, every aspect.
pub(crate) fn range(&self) -> vk::ImageSubresourceRange {
range(&self.attachment)
}
@@ -555,6 +570,11 @@ pub(crate) struct Pass {
pub(crate) reach: [u32; 2],
/// Every attachment's samples, one bit: the pass refuses attachments of two counts.
pub(crate) samples: vk::SampleCountFlags,
/// The layers every attachment and resolve renders from its own slice:
/// `renderTargetArrayLength`, at least 1. The rendering's `layerCount`, and the length each
/// draw pushes to a vertex function that writes `[[render_target_array_index]]`
/// (`PushField::RenderTargetArrayLength`), which stores `Layer` 0 for an index at or past it.
pub(crate) layers: u32,
/// Whether any attachment resolves: a pass that resolves nothing walks no resolve as its
/// encoder begins and ends ([`Pass::resolves`]).
pub(crate) resolving: bool,
@@ -618,7 +638,7 @@ impl Pass {
offset: vk::Offset2D { x: 0, y: 0 },
extent: vk::Extent2D { width, height },
})
.layer_count(1)
.layer_count(self.layers)
.color_attachments(&colors);
if let Some(depth) = &depth {
info = info.depth_attachment(depth);
@@ -627,9 +647,10 @@ impl Pass {
info = info.stencil_attachment(stencil);
}
// SAFETY: as the caller states; the render area (`reach`) lies inside every attachment,
// and every draw's scissor inside Metal's area, which lies inside it; each attachment is a
// view of one level and layer of its image, and a depth and a stencil attachment both set
// are one view.
// and every draw's scissor inside Metal's area, which lies inside it; each attachment and
// resolve is a view of one level and the pass's layers of its image, at most the device's
// `maxFramebufferLayers` (`Pass::check`), and a depth and a stencil attachment both set are
// one view.
unsafe { device.cmd_begin_rendering(command, &info) };
}
@@ -642,6 +663,11 @@ impl Pass {
/// attachment's view cannot be made.
pub(crate) fn check(core: &Arc<Core>, d: &RenderPassDescriptor) -> Result<Pass, Error> {
let gap = |kind| Error::Unsupported(Gap::RenderPass { kind });
// Metal's 0 and 1 both render the attachment's slice alone.
let layers = d.render_target_array_length.max(1);
if layers > core.limits.max_framebuffer_layers {
return Err(gap(RenderPassKind::ArrayLength));
}
let mine = |texture: &Texture| match texture.is_of(core) {
true => Ok(()),
false => Err(Error::Refused(Refusal::OtherDevice)),
@@ -664,7 +690,7 @@ impl Pass {
pixel_format: pf,
}));
}
let attachment = texture.attachment(c.level, c.slice)?;
let attachment = texture.attachment(c.level, c.slice, layers)?;
let resolve = match (
resolving(c.store_action, c.resolve_texture.is_some())?,
&c.resolve_texture,
@@ -728,7 +754,7 @@ impl Pass {
pixel_format: pf,
}));
}
let attachment = texture.attachment(z.level, z.slice)?;
let attachment = texture.attachment(z.level, z.slice, layers)?;
let resolve = match (
resolving(z.store_action, z.resolve_texture.is_some())?,
&z.resolve_texture,
@@ -790,7 +816,7 @@ impl Pass {
pixel_format: pf,
}));
}
let attachment = texture.attachment(s.level, s.slice)?;
let attachment = texture.attachment(s.level, s.slice, layers)?;
let resolve = match (
resolving(s.store_action, s.resolve_texture.is_some())?,
&s.resolve_texture,
@@ -863,6 +889,7 @@ impl Pass {
area: [u32::MAX; 2],
reach: [u32::MAX; 2],
samples: vk::SampleCountFlags::empty(),
layers,
resolving: any_resolve,
};
let colors = pass.colors.iter().flatten();
@@ -991,7 +1018,7 @@ struct ResolveInto<'a> {
}
/// The resolve of `texture`'s attachment `attachment` into `into` by `mode`: a view of the
/// resolve texture's level and slice, as an attachment's.
/// resolve texture's level and the attachment's layers from its slice, as an attachment's.
///
/// Err: [`Refusal::OtherDevice`] for another device's resolve texture; [`Gap::RenderPass`] of
/// [`RenderPassKind::Resolve`] for an attachment of one sample, and for a resolve texture of
@@ -1018,7 +1045,7 @@ fn resolve(
{
return gap(RenderPassKind::Resolve);
}
let view = into.texture.resolve_attachment(into.level, into.slice)?;
let view = (into.texture).resolve_attachment(into.level, into.slice, attachment.layers)?;
if into.depth_plane != 0 {
return gap(RenderPassKind::TextureType);
}
@@ -735,6 +735,10 @@ pub(crate) enum FieldValue {
/// attachment's texture's second element: its view in the feedback layout, or of its image's
/// shadow on a device without the attachment feedback loop (`crate::render_encoder`).
FetchedColor(u32),
/// A `u32`: the layers the draw's pass renders (`renderTargetArrayLength`, at least 1), at or
/// past which a vertex function's `[[render_target_array_index]]` stores `Layer` 0
/// (`PushField::RenderTargetArrayLength`).
RenderTargetArrayLength,
}
/// A `VkPipeline`'s specialization: the threadgroup size, the threadgroup memory lengths in the
+12
View File
@@ -497,6 +497,14 @@ fn draws(
// names (`FieldValue::FetchedColor`); one read through an input attachment or a storage
// image is a descriptor, which the translator refuses under the identity domains.
RuntimeFact::FramebufferFetch { .. } => {}
// A vertex function's `[[render_target_array_index]]`, in its one form: the variant
// that writes `Layer`, which reads the pass's length from its push field
// (`FieldValue::RenderTargetArrayLength`). The variant that writes none renders every
// index into the pass's first layer, so a draw of it in a layered pass is not
// supplied.
RuntimeFact::RenderTargetArrayLength {
layer_dropped: false,
} => {}
// `RuntimeFact` is non-exhaustive: a fact this match does not name is one a draw does
// not supply.
_ => return Err(draw_input()),
@@ -641,6 +649,10 @@ fn draws(
fetched.push(color);
FieldValue::FetchedColor(color)
}
// The pass's length, below which the vertex function's index selects its layer.
PushField::RenderTargetArrayLength if at == VERTEX => {
FieldValue::RenderTargetArrayLength
}
_ => return Err(draw_input()),
};
fields.push((offset, at, value));
@@ -188,11 +188,11 @@ struct Moved {
home: vk::ImageLayout,
}
/// An image a draw moves to the feedback layout: its attachment's level and layer from the layout
/// An image a draw moves to the feedback layout: its attachment's level and layers from the layout
/// the pass renders it in, the rest of it from home.
struct Move {
moved: Moved,
/// The attachment's level and layer.
/// The attachment's level and layers.
rendered: vk::ImageSubresourceRange,
from: vk::ImageLayout,
}
@@ -2076,7 +2076,7 @@ impl RenderCommandEncoder {
continue;
};
let a = &target.attachment;
let reaches = texture.reaches(a.level, a.layer);
let reaches = texture.reaches(a.level, a.layer, a.layers);
let moved = (self.moved.iter()).any(|m| m.hazard == hazard)
|| (found.moves.iter()).any(|m| m.moved.hazard == hazard);
if !reaches && !moved {
@@ -2093,6 +2093,12 @@ impl RenderCommandEncoder {
}));
}
if !texture.looped() {
// A shadow holds what one layer of its attachment rendered.
if a.layers > 1 {
return Err(Error::Unsupported(Gap::Draw {
kind: DrawKind::AttachmentRead,
}));
}
// What the slot reads: at the fragment's own pixel, or all its texture reaches.
let own = (table == FRAGMENT && draws.own_pixel.binary_search(&slot).is_ok())
.then_some(drawn);
@@ -2653,6 +2659,9 @@ fn fill_push(
.map_or(0, |target| target.texture.second_resource_id().index);
bytes[at..at + 4].copy_from_slice(&index.to_le_bytes());
}
FieldValue::RenderTargetArrayLength => {
bytes[at..at + 4].copy_from_slice(&pass.layers.to_le_bytes());
}
// A render content has no dispatch or stage-in region (`render::draws`).
FieldValue::DispatchRegion | FieldValue::StageInRegion => {}
}
@@ -2686,7 +2695,7 @@ fn region(area: &Area, aspects: vk::ImageAspectFlags) -> vk::ImageCopy {
}
}
/// `whole` but `rendered`, one level and layer of it: at most four ranges.
/// `whole` but `rendered`, one level and its layers: at most four ranges.
fn around(
whole: vk::ImageSubresourceRange,
rendered: vk::ImageSubresourceRange,
@@ -2712,7 +2721,10 @@ fn around(
levels(whole.base_mip_level, level),
levels(level + 1, whole.base_mip_level + whole.level_count),
layers(whole.base_array_layer, layer),
layers(layer + 1, whole.base_array_layer + whole.layer_count),
layers(
layer + rendered.layer_count,
whole.base_array_layer + whole.layer_count,
),
]
.into_iter()
.flatten()
+11 -5
View File
@@ -66,6 +66,7 @@ fn at_the_floor() -> Queried {
features.core.shader_clip_distance = vk::TRUE;
features.core.shader_tessellation_and_geometry_point_size = vk::TRUE;
features.core.large_points = vk::TRUE;
features.vulkan12.shader_output_layer = vk::TRUE;
features.core.shader_int16 = vk::TRUE;
features.vulkan12.shader_int8 = vk::TRUE;
features.vulkan11.storage_buffer16_bit_access = vk::TRUE;
@@ -245,7 +246,7 @@ fn the_translator_sees_only_what_device_creation_enables() {
use metal2vulkan::device::{VkExtension, VkFeature};
let mut device = at_the_floor();
device.features.core.geometry_shader = vk::TRUE;
device.features.vulkan12.shader_output_layer = vk::TRUE;
device.features.vulkan12.shader_output_viewport_index = vk::TRUE;
device.features.vulkan13.robust_image_access = vk::TRUE;
device.features.robustness2.robust_buffer_access2 = vk::TRUE;
let capabilities = decide(&device).unwrap_or_else(|below| panic!("{below}"));
@@ -285,7 +286,7 @@ fn the_translator_sees_only_what_device_creation_enables() {
assert!(enables.features.contains(&VkFeature::NullDescriptor));
for reported in [
VkFeature::GeometryShader,
VkFeature::ShaderOutputLayer,
VkFeature::ShaderOutputViewportIndex,
VkFeature::RobustBufferAccess2,
VkFeature::RobustBufferAccess,
] {
@@ -301,7 +302,7 @@ fn a_device_at_the_floor_is_above_it() {
// Features beyond the floor are not enabled.
device.features.core.geometry_shader = vk::TRUE;
device.features.vulkan11.storage_input_output16 = vk::TRUE;
device.features.vulkan12.shader_output_layer = vk::TRUE;
device.features.vulkan12.shader_output_viewport_index = vk::TRUE;
let capabilities = decide(&device).unwrap_or_else(|below| panic!("{below}"));
assert!(!capabilities.float16);
assert!(!capabilities.storage_read_without_format);
@@ -337,7 +338,8 @@ fn a_device_at_the_floor_is_above_it() {
}
assert_eq!(enabled.core.geometry_shader, vk::FALSE);
assert_eq!(enabled.vulkan11.storage_input_output16, vk::FALSE);
assert_eq!(enabled.vulkan12.shader_output_layer, vk::FALSE);
assert_eq!(enabled.vulkan12.shader_output_viewport_index, vk::FALSE);
assert_eq!(enabled.vulkan12.shader_output_layer, vk::TRUE);
assert_eq!(enabled.vulkan13.robust_image_access, vk::TRUE);
assert_eq!(enabled.core.independent_blend, vk::TRUE);
assert_eq!(enabled.core.fragment_stores_and_atomics, vk::TRUE);
@@ -366,7 +368,7 @@ fn each_missing_feature_is_named() {
const CORE: &str = "VkPhysicalDeviceFeatures";
const ROBUSTNESS2: &str = "VkPhysicalDeviceRobustness2FeaturesEXT";
type Clear = fn(&mut Features);
let cases: [(Clear, Missing); 52] = [
let cases: [(Clear, Missing); 53] = [
(
|f| f.vulkan12.buffer_device_address = vk::FALSE,
feature(V12, "bufferDeviceAddress"),
@@ -570,6 +572,10 @@ fn each_missing_feature_is_named() {
|f| f.core.shader_tessellation_and_geometry_point_size = vk::FALSE,
feature(CORE, "shaderTessellationAndGeometryPointSize"),
),
(
|f| f.vulkan12.shader_output_layer = vk::FALSE,
feature(V12, "shaderOutputLayer"),
),
(
|f| f.core.large_points = vk::FALSE,
feature(CORE, "largePoints"),
@@ -0,0 +1,234 @@
//! Layered rendering (`RenderPassDescriptor::render_target_array_length`), under a device cfg on
//! every device of the cfg's kind: the floor's `shaderOutputLayer` is enabled, a vertex function's
//! `[[render_target_array_index]]` `i` renders slice `slice + i` of a layered pass, an index at or
//! past the pass's length renders its first slice, the pass's clear covers every layer, a pass of
//! one layer renders its slice whatever index the vertex function writes, and the fragment
//! function reads the index as written, in each. A vertex function whose index may differ among a
//! primitive's vertices is refused at creation, naming `LayeredRendering`.
//!
//! `rt6_layered_vertex` (engine `rt6_layered`) draws the fullscreen triangle once per instance,
//! instance `i` writing index `layers[i]`; `rt6_layered_fragment` writes `(i + 1) << 8 | index`.
//! `rt6_first_vertex` writes each vertex's own index (`indices[vid]`).
//!
//! `llvm-as` assembles the functions; without it the test skips visibly.
#[cfg(any(m2v_gpu, m2v_cpu_icd))]
mod on_device {
use crate::tests::command::on_device::each_device;
use crate::tests::draw::on_device::{library, run, Buffers, SIDE};
use crate::{
ClearColor, ColorAttachmentDescriptor, Device, Error, FunctionDescriptor, HostBytes,
LoadAction, PixelFormat, PrimitiveType, Region, RenderPassDescriptor,
RenderPipelineDescriptor, RenderPipelineState, StageSource, StorageMode, Texture,
TextureDescriptor, TextureType, TextureUsage,
};
use metal2vulkan::device::VkFeature;
use metal2vulkan::error::Feature;
use metal2vulkan_devtools::engine_dir;
/// What priming leaves in every slice before a pass: no fragment's word and not the clear.
const PRIOR: u32 = 99;
/// What a pass's `Clear` load leaves in a layer it covers: no fragment's word.
const CLEAR: u32 = 7;
/// The word `rt6_layered_fragment` writes for instance `instance`, which wrote `index`.
const fn word(instance: u32, index: u32) -> u32 {
(instance + 1) << 8 | index
}
/// One pass and what each slice of its target holds after it.
struct Layered {
what: &'static str,
texture_type: TextureType,
slices: u32,
slice: u32,
length: u32,
/// The index each instance writes.
layers: &'static [u32],
/// What each slice of the target holds after the pass.
expect: &'static [u32],
}
const PASSES: [Layered; 4] = [
// Slices 1 to 3 of four: instance 0 renders layer 1 (slice 2), instance 1 layer 0
// (slice 1), and instance 2's index 5, past the length, layer 0 too, over instance 1;
// layer 2 (slice 3) keeps the clear, slice 0 its prior.
Layered {
what: "a 2D array's slices 1 to 3",
texture_type: TextureType::Type2DArray,
slices: 4,
slice: 1,
length: 3,
layers: &[1, 0, 5],
expect: &[PRIOR, word(2, 5), word(0, 1), CLEAR],
},
// A cube's six faces: faces 5 and 2 drawn, the other four keep the clear.
Layered {
what: "a cube's six faces",
texture_type: TextureType::Cube,
slices: 6,
slice: 0,
length: 6,
layers: &[5, 2],
expect: &[CLEAR, CLEAR, word(1, 2), CLEAR, CLEAR, word(0, 5)],
},
// Passes of one layer, of Metal's default length 0 and of length 1: index 3 renders the
// attachment's slice, and the fragment reads 3.
Layered {
what: "a 2D array's slice 1 alone, its vertex function writing index 3",
texture_type: TextureType::Type2DArray,
slices: 2,
slice: 1,
length: 0,
layers: &[3],
expect: &[PRIOR, word(0, 3)],
},
Layered {
what: "a 2D texture in a pass of length 1, its vertex function writing index 3",
texture_type: TextureType::Type2D,
slices: 1,
slice: 0,
length: 1,
layers: &[3],
expect: &[word(0, 3)],
},
];
/// A Shared render target of `R32Uint`, `SIDE` a side, every slice primed to [`PRIOR`].
fn target(device: &Device, texture_type: TextureType, slices: u32) -> Texture {
let mut d = TextureDescriptor::new(texture_type, PixelFormat::R32Uint, SIDE, SIDE);
if texture_type == TextureType::Type2DArray {
d.array_length = slices;
}
d.usage = TextureUsage::RENDER_TARGET;
d.storage_mode = StorageMode::Shared;
let texture = (device.new_texture_for_views(&d)).expect("a target");
let row = (SIDE * 4) as u64;
let prior: Vec<u8> = (0..SIDE * SIDE).flat_map(|_| PRIOR.to_le_bytes()).collect();
for slice in 0..slices {
(texture.replace_region(whole(), 0, slice, HostBytes::from(&prior[..]), row, 0))
.expect("a primed slice");
}
texture
}
fn whole() -> Region {
Region {
origin: [0; 3],
size: [SIDE, SIDE, 1],
}
}
/// The words of slice `slice` of `texture`.
fn words(texture: &Texture, slice: u32) -> Vec<u32> {
let row = (SIDE * 4) as u64;
let mut bytes = vec![0; (row * u64::from(SIDE)) as usize];
(texture.get_bytes(&mut bytes, row, 0, whole(), 0, slice)).expect("get_bytes");
(bytes.as_chunks::<4>().0.iter())
.map(|w| u32::from_le_bytes(*w))
.collect()
}
/// Draws `pass` with `state` and checks every texel of every slice of its target.
fn draw(name: &str, device: &Device, state: &RenderPipelineState, pass: &Layered) -> u32 {
let ok = |result: Result<(), Error>| {
result.unwrap_or_else(|error| panic!("{name}: {}: {error}", pass.what))
};
let texture = target(device, pass.texture_type, pass.slices);
let mut d = RenderPassDescriptor::default();
let c = &mut d.color_attachments[0];
c.texture = Some(texture.clone());
c.slice = pass.slice;
c.load_action = LoadAction::Clear;
c.clear_color = ClearColor {
red: f64::from(CLEAR),
green: 0.0,
blue: 0.0,
alpha: 1.0,
};
d.render_target_array_length = pass.length;
let mut buffers = Buffers::new(device);
let layers: Vec<u8> = (pass.layers.iter()).flat_map(|l| l.to_le_bytes()).collect();
let layers = buffers.of(device, &layers);
let queue = device.new_command_queue(4).expect("a queue");
let command_buffer = queue.command_buffer().expect("a command buffer");
let mut encoder = (command_buffer.render_command_encoder(&d))
.unwrap_or_else(|error| panic!("{name}: {}: {error}", pass.what));
ok(encoder.set_render_pipeline_state(state));
ok(encoder.set_vertex_buffer(Some(&layers), 0, 0));
let instances = pass.layers.len() as u32;
ok(encoder.draw_primitives(PrimitiveType::Triangle, 0, 3, instances, 0));
encoder.end_encoding();
run(name, &command_buffer);
for (slice, &want) in pass.expect.iter().enumerate() {
let got = words(&texture, slice as u32);
assert!(
got.iter().all(|&w| w == want),
"{name}: {}: slice {slice} holds {:?}, Metal's {want:#x}",
pass.what,
(got.iter().take(4))
.map(|w| format!("{w:#x}"))
.collect::<Vec<_>>()
);
}
pass.expect.len() as u32 * SIDE * SIDE
}
/// Every device renders Metal's layers, from one form of the vertex function, and refuses a
/// vertex function whose index may differ among a primitive's vertices.
#[test]
fn every_device_renders_metal_s_layers() {
let Some(layered) = library(&engine_dir().join("rt6_layered.ll")) else {
return;
};
let Some(first_vertex) = library(&engine_dir().join("rt6_first_vertex.ll")) else {
return;
};
let function = |library: &crate::Library, name| {
StageSource::Function(FunctionDescriptor::new(
library.function(name).expect("the function"),
))
};
let descriptor = |library, vertex, fragment| {
let mut d = RenderPipelineDescriptor::new(function(library, vertex));
d.fragment = Some(function(library, fragment));
d.color_attachments[0] = Some(ColorAttachmentDescriptor::new(PixelFormat::R32Uint));
d
};
each_device("layered", |name, _, device| {
let core = device.core();
let enabled = &core.translator.profile().enabled().features;
assert!(
enabled.contains(&VkFeature::ShaderOutputLayer),
"{name}: shaderOutputLayer, which the floor requires"
);
let layered_state = (device.new_render_pipeline_state(
&descriptor(&layered, "rt6_layered_vertex", "rt6_layered_fragment"),
crate::tests::no_constexpr_samplers,
))
.unwrap_or_else(|error| panic!("{name}: rt6_layered: {error}"));
let texels: u32 = (PASSES.iter())
.map(|pass| draw(name, &device, &layered_state, pass))
.sum();
let differing = device.new_render_pipeline_state(
&descriptor(&first_vertex, "rt6_first_vertex", "rt6_first_vertex_read"),
crate::tests::no_constexpr_samplers,
);
let refused = match differing {
Err(Error::Translation(metal2vulkan::error::Error::Unsupported(u))) => {
assert_eq!(u.feature, Feature::LayeredRendering, "{name}: {u:?}");
u
}
Err(error) => panic!("{name}: rt6_first_vertex: {error}"),
Ok(_) => panic!("{name}: rt6_first_vertex's differing index made a state"),
};
println!(
"layered: {name}: shaderOutputLayer enabled; {texels} texels of {} passes read \
Metal's layers; a differing index refused: {:?} needs {:?}",
PASSES.len(),
refused.feature,
refused.needs
);
});
}
}
@@ -41,6 +41,7 @@ mod kernel_map;
#[cfg(any(m2v_gpu, m2v_cpu_icd))]
mod kernels;
mod large;
mod layered;
#[cfg(any(m2v_gpu, m2v_cpu_icd))]
pub(crate) mod layouts;
mod linear_planes;
+45 -24
View File
@@ -283,17 +283,21 @@ impl ShadowView {
struct AttachmentView {
level: u32,
layer: u32,
layers: u32,
view: vk::ImageView,
}
/// A level and slice of a texture as a render pass attachment ([`Texture::attachment`]).
/// A level and slices of a texture as a render pass attachment ([`Texture::attachment`]).
pub(crate) struct Attachment {
/// The image view of the level and layer, every aspect, with the identity swizzle.
/// The image view of the level and layers, every aspect, with the identity swizzle.
pub(crate) view: vk::ImageView,
pub(crate) image: vk::Image,
/// The level and layer in the image.
/// The level and first layer in the image.
pub(crate) level: u32,
pub(crate) layer: u32,
/// The layers the view holds from `layer`: its pass's length (`renderTargetArrayLength`), at
/// least 1.
pub(crate) layers: u32,
/// Every aspect of the image's format.
pub(crate) aspects: vk::ImageAspectFlags,
/// The image's home layout.
@@ -4208,13 +4212,14 @@ pub(crate) trait TextureObject {
self.object().image.image
}
/// Whether it reaches `level` and `layer` of its image: a view reaches its own levels and
/// slices alone.
fn reaches(&self, level: u32, layer: u32) -> bool {
/// Whether it reaches `level` and one of the `layers` layers from `layer` of its image: a view
/// reaches its own levels and slices alone.
fn reaches(&self, level: u32, layer: u32, layers: u32) -> bool {
let d = &self.object().descriptor;
let [first_level, first_layer] = TextureInner::base(self.object());
(first_level..first_level + d.mipmap_level_count).contains(&level)
&& (first_layer..first_layer + slices(d)).contains(&layer)
&& layer < first_layer + slices(d)
&& first_layer < layer + layers
}
/// Whether a draw may read an attachment of its own pass through it ([`Image`]'s
@@ -4360,25 +4365,28 @@ pub(crate) trait TextureObject {
self.object().emulation
}
/// `level` and `slice` of the texture as a render pass attachment: the image view of that
/// one level and layer of its image, every aspect, with the identity swizzle, made at the
/// first pass that renders into it and kept with the texture.
/// `level` and the `layers` slices from `slice` of the texture as a render pass attachment:
/// the image view of that one level and those layers of its image (a 2D view of one layer, a
/// 2D array view of more), every aspect, with the identity swizzle, made at the first pass
/// that renders into it and kept with the texture.
///
/// Err: [`Refusal::AttachmentUsage`] for a texture made without `RenderTarget` usage;
/// [`Gap::RenderPass`] of [`RenderPassKind::TextureType`] for one but a 2D texture, a 2D
/// array, a cube, a cube array or a 2D multisample texture or array; [`Refusal::AttachmentPlace`] for a level or slice past the texture's;
/// [`Error::Vulkan`] where the view cannot be made.
fn attachment(&self, level: u32, slice: u32) -> Result<Attachment, Error> {
/// array, a cube, a cube array or a 2D multisample texture or array;
/// [`Refusal::AttachmentPlace`] for a level or slice past the texture's, the last of the
/// `layers` slices included; [`Error::Vulkan`] where the view cannot be made.
fn attachment(&self, level: u32, slice: u32, layers: u32) -> Result<Attachment, Error> {
let d = &self.object().descriptor;
if !d.usage.is_empty() && !d.usage.contains(TextureUsage::RENDER_TARGET) {
return Err(Error::Refused(Refusal::AttachmentUsage {
pixel_format: d.pixel_format,
}));
}
self.attachment_view(level, slice)
self.attachment_view(level, slice, layers)
}
/// `level` and `slice` of the texture as a pass's resolve attachment, as [`attachment`]
/// `level` and the `layers` slices from `slice` of the texture as a pass's resolve
/// attachment, as [`attachment`]
/// views them, of any usage, as Metal resolves into a texture of any usage: where its image
/// has an attachment usage, which `RenderTarget` usage gives it and a one-sample colour
/// texture takes where its format renders (`Plan::resolves`).
@@ -4390,7 +4398,7 @@ pub(crate) trait TextureObject {
/// for the rest.
///
/// [`attachment`]: TextureObject::attachment
fn resolve_attachment(&self, level: u32, slice: u32) -> Result<Attachment, Error> {
fn resolve_attachment(&self, level: u32, slice: u32, layers: u32) -> Result<Attachment, Error> {
let renders =
vk::ImageUsageFlags::COLOR_ATTACHMENT | vk::ImageUsageFlags::DEPTH_STENCIL_ATTACHMENT;
if !self.object().image.usage.intersects(renders) {
@@ -4398,16 +4406,17 @@ pub(crate) trait TextureObject {
kind: RenderPassKind::ResolveUsage,
}));
}
self.attachment_view(level, slice)
self.attachment_view(level, slice, layers)
}
/// `level` and `slice` of the texture as a render pass attachment, as [`attachment`] views
/// them, whatever its usage: the caller checked that its image has the attachment usage.
/// `level` and the `layers` slices from `slice` of the texture as a render pass attachment,
/// as [`attachment`] views them, whatever its usage: the caller checked that its image has
/// the attachment usage.
///
/// Err: as [`attachment`] but [`Refusal::AttachmentUsage`].
///
/// [`attachment`]: TextureObject::attachment
fn attachment_view(&self, level: u32, slice: u32) -> Result<Attachment, Error> {
fn attachment_view(&self, level: u32, slice: u32, layers: u32) -> Result<Attachment, Error> {
let d = &self.object().descriptor;
let gap = |kind| Err(Error::Unsupported(Gap::RenderPass { kind }));
match d.texture_type {
@@ -4422,6 +4431,12 @@ pub(crate) trait TextureObject {
if level >= d.mipmap_level_count || slice >= slices(d) {
return Err(Error::Refused(Refusal::AttachmentPlace { level, slice }));
}
if slices(d) - slice < layers {
return Err(Error::Refused(Refusal::AttachmentPlace {
level,
slice: slice + layers - 1,
}));
}
let [first_level, first_layer] = TextureInner::base(self.object());
let (level_in_image, layer) = (first_level + level, first_layer + slice);
let image = &self.object().image;
@@ -4441,7 +4456,7 @@ pub(crate) trait TextureObject {
};
let mut views = lock(&self.object().attachments);
let kept = (views.iter())
.find(|a| a.level == level_in_image && a.layer == layer)
.find(|a| a.level == level_in_image && a.layer == layer && a.layers == layers)
.map(|a| a.view);
let view = match kept {
Some(view) => view,
@@ -4452,16 +4467,20 @@ pub(crate) trait TextureObject {
base_mip_level: level_in_image,
level_count: 1,
base_array_layer: layer,
layer_count: 1,
layer_count: layers,
};
// SAFETY: the image is bound, of the texture's format, holds the level and layer
let kind = match layers {
1 => vk::ImageViewType::TYPE_2D,
_ => vk::ImageViewType::TYPE_2D_ARRAY,
};
// SAFETY: the image is bound, of the texture's format, holds the level and layers
// (the texture's own, which lie in its image), and has the attachment usage its
// render target usage or its resolves gave it (the caller's check).
let view = unsafe {
image_view(
&core.device,
image.image,
vk::ImageViewType::TYPE_2D,
kind,
self.object().format,
vk::ComponentMapping::default(),
range,
@@ -4472,6 +4491,7 @@ pub(crate) trait TextureObject {
views.push(AttachmentView {
level: level_in_image,
layer,
layers,
view,
});
view
@@ -4482,6 +4502,7 @@ pub(crate) trait TextureObject {
image: image.image,
level: level_in_image,
layer,
layers,
aspects: image.aspects,
home: image.home,
extent: [(d.width >> level).max(1), (d.height >> level).max(1)],
@@ -1170,7 +1170,8 @@
"vulkanMemoryModelDeviceScope": true,
"shaderSubgroupExtendedTypes": true,
"timelineSemaphore": true,
"hostQueryReset": true
"hostQueryReset": true,
"shaderOutputLayer": true
},
"VkPhysicalDeviceVulkan13Features": {
"subgroupSizeControl": true,
@@ -1767,6 +1767,7 @@ field metal2vulkan-runtime::RenderPassDepthAttachmentDescriptor.store_action pub
field metal2vulkan-runtime::RenderPassDepthAttachmentDescriptor.texture pub texture: Option<Texture>
field metal2vulkan-runtime::RenderPassDescriptor.color_attachments pub color_attachments: [RenderPassColorAttachmentDescriptor; MAX_COLOR_ATTACHMENTS]
field metal2vulkan-runtime::RenderPassDescriptor.depth_attachment pub depth_attachment: RenderPassDepthAttachmentDescriptor
field metal2vulkan-runtime::RenderPassDescriptor.render_target_array_length pub render_target_array_length: u32
field metal2vulkan-runtime::RenderPassDescriptor.render_target_height pub render_target_height: u32
field metal2vulkan-runtime::RenderPassDescriptor.render_target_width pub render_target_width: u32
field metal2vulkan-runtime::RenderPassDescriptor.stencil_attachment pub stencil_attachment: RenderPassStencilAttachmentDescriptor
@@ -9450,6 +9451,7 @@ variant metal2vulkan-runtime::Refusal::ViewportNotFinite ViewportNotFinite
variant metal2vulkan-runtime::Refusal::WaitOnOwnThread WaitOnOwnThread
variant metal2vulkan-runtime::Refusal::ZeroRangePastBlock ZeroRangePastBlock { offset: u64, length: u64, block_len: u64 }
variant metal2vulkan-runtime::Refusal::ZeroRangeShared ZeroRangeShared { block: BlockId }
variant metal2vulkan-runtime::RenderPassKind::ArrayLength ArrayLength
variant metal2vulkan-runtime::RenderPassKind::ClearDepth ClearDepth
variant metal2vulkan-runtime::RenderPassKind::ClearFormat ClearFormat
variant metal2vulkan-runtime::RenderPassKind::DepthStencilViews DepthStencilViews
Can't render this file because it is too large.
+66 -67
View File
@@ -30,19 +30,19 @@ Its limits, measured rather than asserted:
| | |
|---|---|
| implemented Metal items | 592 |
| implemented Metal items | 593 |
| of those, unreachable: `objc2-metal` binds no name for them | 1 |
| so reachable by some case | 591 |
| of the reachable, exercised by the suite's Metal leg | 518 |
| so reachable by some case | 592 |
| of the reachable, exercised by the suite's Metal leg | 519 |
| of the reachable, not exercised | 73 |
| share of the reachable exercised | 88% |
| of those exercised, no case reaching it loosens anything | 302 |
| of those exercised, a case reaching it loosens some site | 216 |
| of those exercised, a case reaching it loosens some site | 217 |
| case modules | 179 |
| committed recordings | 1319 |
| distinct SDK items the Metal leg reaches, of any status | 804 |
| of those, reached only where this cannot name the family | 5 |
| ledger rows (a case whose gap is recorded) | 7689 |
| ledger rows (a case whose gap is recorded) | 7688 |
| declared crossings of the option space (pairs put to Metal at once) | 26 |
| declared crossings that are no pair of it (a boolean or numeric field, or one type in two slots) | 30 |
@@ -418,7 +418,7 @@ Every container with an implemented item, by how much of it the suite reaches. *
| `MTLRenderPassColorAttachmentDescriptor` | 2 | 0 | 2 | 0 | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`… |
| `MTLRenderPassColorAttachmentDescriptorArray` | 3 | 0 | 3 | 0 | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`… |
| `MTLRenderPassDepthAttachmentDescriptor` | 3 | 0 | 3 | 0 | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`… |
| `MTLRenderPassDescriptor` | 8 | 0 | 8 | 0 | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`… |
| `MTLRenderPassDescriptor` | 9 | 0 | 9 | 0 | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`… |
| `MTLRenderPassStencilAttachmentDescriptor` | 3 | 0 | 3 | 0 | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`… |
| `MTLRenderPipelineColorAttachmentDescriptor` | 10 | 0 | 10 | 0 | `alpha_coverage_pairs`, `binary_archives`, `blend_interactions`, `blend_sweeps`… |
| `MTLRenderPipelineDescriptor` | 33 | 0 | 33 | 0 | `alpha_coverage_pairs`, `binary_archives`, `blend_interactions`, `blend_sweeps`… |
@@ -465,7 +465,7 @@ A container is one Objective-C type; the SDK header it sits in is the family of
| `MTLEvent.h` | 6 | 5 | 1 |
| `MTLFence.h` | 1 | 0 | 1 |
| `MTLPipeline.h` | 5 | 4 | 1 |
| `MTLRenderPass.h` | 30 | 29 | 1 |
| `MTLRenderPass.h` | 31 | 30 | 1 |
| `MTLTexture.h` | 39 | 38 | 1 |
| `MTLAllocation.h` | 1 | 1 | 0 |
| `MTLBlitCommandEncoder.h` | 12 | 12 | 0 |
@@ -527,7 +527,7 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| family | cases | Metal ran | compared | items reached |
|---|---|---|---|---|
| `alpha_coverage_pairs` | 17 | 17 | 1 tolerance(s): `Degradation` | 113 |
| `alpha_coverage_pairs` | 17 | 17 | 1 tolerance(s): `Degradation` | 114 |
| `argument_encoder_crossings` | 4 | 4 | every field | 41 |
| `argument_encoders` | 5 | 5 | every field | 57 |
| `astc_textures` | 42 | 42 | 1 tolerance(s): `Degradation` | 41 |
@@ -535,20 +535,20 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| `attribute_strides` | 4 | 4 | every field | 46 |
| `bicubic_texel_classes` | 1 | 1 | every field | 31 |
| `binary_archives` | 6 | 6 | every field | 27 |
| `blend_interactions` | 4 | 4 | every field | 117 |
| `blend_sweeps` | 12 | 12 | every field | 117 |
| `blend_interactions` | 4 | 4 | every field | 118 |
| `blend_sweeps` | 12 | 12 | every field | 118 |
| `blit_encoder_commands` | 11 | 11 | every field | 48 |
| `blit_indirect_commands` | 3 | 3 | every field | 83 |
| `blit_indirect_commands` | 3 | 3 | every field | 84 |
| `border_swizzles` | 8 | 8 | every field | 58 |
| `buffer_bind_off_alignment` | 1 | 1 | every field | 22 |
| `buffer_blits` | 4 | 4 | every field | 21 |
| `buffer_depth_samples` | 5 | 5 | every field | 59 |
| `buffer_tails` | 2 | 2 | every field | 50 |
| `buffer_target_clears` | 6 | 6 | 1 tolerance(s): `AcceptedDifference` | 58 |
| `buffer_target_clears` | 6 | 6 | 1 tolerance(s): `AcceptedDifference` | 59 |
| `buffer_texture_blits` | 2 | 2 | every field | 38 |
| `buffer_textures` | 3 | 2 | every field | 44 |
| `chroma_pairs` | 6 | 6 | every field | 66 |
| `color_write_masks` | 5 | 5 | every field | 114 |
| `color_write_masks` | 5 | 5 | every field | 115 |
| `command_buffer_facts` | 1 | 1 | every field | 23 |
| `command_queues` | 1 | 1 | every field | 5 |
| `compressed_blits` | 4 | 4 | every field | 40 |
@@ -558,38 +558,38 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| `compute_encoder_commands` | 8 | 8 | every field | 62 |
| `compute_heap_residency` | 1 | 1 | every field | 42 |
| `compute_pipeline_descriptors` | 3 | 3 | 1 tolerance(s): `AcceptedDifference` | 22 |
| `compute_render_chains` | 3 | 3 | every field | 141 |
| `compute_render_chains` | 3 | 3 | every field | 142 |
| `compute_threadgroups` | 2 | 1 | every field | 27 |
| `copy_out_strides` | 1 | 1 | every field | 38 |
| `denormal_word_fetches` | 1 | 1 | every field | 41 |
| `depth_resolve_pairs` | 2 | 2 | every field | 131 |
| `depth_stencil_space` | 8 | 8 | every field | 134 |
| `depth_resolve_pairs` | 2 | 2 | every field | 132 |
| `depth_stencil_space` | 8 | 8 | every field | 135 |
| `depth_texel_reads` | 1 | 1 | every field | 48 |
| `device_queries` | 5 | 5 | every field | 3 |
| `discard_hoist` | 1 | 1 | 1 tolerance(s): `Degradation` | 135 |
| `draw_state_changes` | 1 | 1 | every field | 137 |
| `discard_hoist` | 1 | 1 | 1 tolerance(s): `Degradation` | 136 |
| `draw_state_changes` | 1 | 1 | every field | 138 |
| `dynamic_libraries` | 3 | 3 | every field | 6 |
| `empty_command_buffers` | 1 | 1 | every field | 20 |
| `etc_textures` | 10 | 10 | every field | 41 |
| `event_orders` | 5 | 5 | 4 tolerance(s): `AcceptedDifference` | 27 |
| `extended_range_blends` | 18 | 18 | every field | 124 |
| `extended_range_gamut` | 39 | 39 | every field | 115 |
| `extended_range_gradients` | 8 | 8 | every field | 116 |
| `extended_range_blends` | 18 | 18 | every field | 125 |
| `extended_range_gamut` | 39 | 39 | every field | 116 |
| `extended_range_gradients` | 8 | 8 | every field | 117 |
| `extended_range_planes` | 4 | 4 | every field | 28 |
| `extended_range_targets` | 22 | 22 | every field | 121 |
| `extended_range_targets` | 22 | 22 | every field | 122 |
| `extended_range_two_planes` | 2 | 2 | every field | 32 |
| `extended_swizzles` | 15 | 15 | every field | 58 |
| `fence_orders` | 6 | 6 | 1 tolerance(s): `AcceptedDifference` | 27 |
| `fetch_ordered` | 6 | 6 | every field | 116 |
| `fetch_ordered` | 6 | 6 | every field | 117 |
| `format_copies` | 16 | 16 | every field | 39 |
| `format_footprints` | 6 | 6 | 1 tolerance(s): `AcceptedDifference` | 19 |
| `fragment_imageblock_reflection` | 1 | 1 | every field | 74 |
| `frame_chains` | 1 | 1 | every field | 138 |
| `frame_chains` | 1 | 1 | every field | 139 |
| `fresh_contents` | 87 | 87 | every field | 41 |
| `function_bindings` | 15 | 15 | every field | 64 |
| `function_constants_half3` | 1 | 1 | every field | 27 |
| `function_facts` | 15 | 15 | every field | 32 |
| `half_output_blends` | 6 | 6 | every field | 117 |
| `half_output_blends` | 6 | 6 | every field | 118 |
| `half_read_nans` | 6 | 6 | every field | 48 |
| `half_storage_writes` | 9 | 9 | every field | 32 |
| `half_texel_nans` | 8 | 8 | every field | 31 |
@@ -598,12 +598,12 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| `heap_facts` | 5 | 5 | every field | 5 |
| `heap_metal_sizes` | 7 | 7 | 1 tolerance(s): `AcceptedDifference` | 14 |
| `host_detach` | 1 | 1 | every field | 18 |
| `host_page_writes` | 4 | 4 | every field | 123 |
| `indirect_command_depth` | 6 | 6 | every field | 147 |
| `indirect_commands` | 9 | 9 | every field | 149 |
| `host_page_writes` | 4 | 4 | every field | 124 |
| `indirect_command_depth` | 6 | 6 | every field | 148 |
| `indirect_commands` | 9 | 9 | every field | 150 |
| `indirect_private_types` | 1 | 0 | every field | 0 |
| `int_attributes` | 1 | 1 | every field | 102 |
| `layered_targets` | 5 | 5 | every field | 131 |
| `int_attributes` | 1 | 1 | every field | 103 |
| `layered_targets` | 5 | 5 | every field | 132 |
| `level_sizes` | 2 | 2 | every field | 41 |
| `library_facts` | 9 | 9 | every field | 38 |
| `math_routines` | 2 | 2 | every field | 25 |
@@ -616,13 +616,13 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| `nan_integer_conversions` | 1 | 1 | 1 tolerance(s): `AcceptedDifference` | 56 |
| `nearest_positions` | 1 | 1 | every field | 48 |
| `norm_storage_writes` | 7 | 7 | every field | 43 |
| `padded_blends` | 17 | 17 | every field | 116 |
| `padded_fetch` | 11 | 11 | every field | 116 |
| `pass_attachment_pairs` | 2 | 2 | every field | 116 |
| `pass_bound_pairs` | 1 | 1 | every field | 117 |
| `padded_blends` | 17 | 17 | every field | 117 |
| `padded_fetch` | 11 | 11 | every field | 117 |
| `pass_attachment_pairs` | 2 | 2 | every field | 117 |
| `pass_bound_pairs` | 1 | 1 | every field | 118 |
| `pass_bytes` | 4 | 4 | every field | 25 |
| `pass_sequence_actions` | 2 | 2 | 1 tolerance(s): `AcceptedDifference` | 132 |
| `pass_start_reads` | 14 | 14 | 2 tolerance(s): `AcceptedDifference` | 122 |
| `pass_sequence_actions` | 2 | 2 | 1 tolerance(s): `AcceptedDifference` | 133 |
| `pass_start_reads` | 14 | 14 | 2 tolerance(s): `AcceptedDifference` | 123 |
| `pipeline_descriptors` | 3 | 3 | every field | 75 |
| `pipeline_facts` | 9 | 9 | every field | 67 |
| `pipeline_functions` | 8 | 8 | every field | 5 |
@@ -632,7 +632,7 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| `pipeline_options` | 21 | 21 | every field | 76 |
| `pixel_downscales` | 7 | 7 | every field | 51 |
| `pixel_samplers` | 20 | 20 | every field | 51 |
| `primitive_type_crossings` | 1 | 1 | every field | 115 |
| `primitive_type_crossings` | 1 | 1 | every field | 116 |
| `pvrtc_cpu_order` | 6 | 6 | every field | 39 |
| `pvrtc_rows` | 8 | 8 | every field | 39 |
| `rate_map_degenerate_forms` | 3 | 3 | every field | 19 |
@@ -640,69 +640,69 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| `rate_maps` | 2 | 2 | every field | 14 |
| `read_through` | 13 | 13 | every field | 61 |
| `read_write_tiers` | 6 | 6 | every field | 46 |
| `render_chains` | 3 | 3 | every field | 135 |
| `render_depth_stencil_state` | 3 | 3 | every field | 135 |
| `render_draw_forms` | 4 | 4 | every field | 120 |
| `render_pass_descriptors` | 12 | 12 | every field | 29 |
| `render_residency` | 2 | 2 | every field | 121 |
| `render_state` | 3 | 3 | every field | 155 |
| `resolve_then_load` | 1 | 1 | every field | 123 |
| `render_chains` | 3 | 3 | every field | 136 |
| `render_depth_stencil_state` | 3 | 3 | every field | 136 |
| `render_draw_forms` | 4 | 4 | every field | 121 |
| `render_pass_descriptors` | 12 | 12 | every field | 30 |
| `render_residency` | 2 | 2 | every field | 122 |
| `render_state` | 3 | 3 | every field | 156 |
| `resolve_then_load` | 1 | 1 | every field | 124 |
| `resource_facts` | 4 | 4 | every field | 23 |
| `rgb10a2_srgb` | 8 | 8 | every field | 76 |
| `rotated_planes` | 20 | 20 | every field | 114 |
| `rotated_targets` | 14 | 14 | every field | 117 |
| `rotated_planes` | 20 | 20 | every field | 115 |
| `rotated_targets` | 14 | 14 | every field | 118 |
| `sample_fills` | 17 | 0 | every field | 0 |
| `sample_positions` | 19 | 16 | every field | 115 |
| `sample_positions` | 19 | 16 | every field | 116 |
| `sampler_crossings` | 8 | 8 | every field | 59 |
| `sampler_filtering` | 15 | 15 | every field | 59 |
| `scheduled_handlers` | 1 | 1 | every field | 16 |
| `shader_stencil` | 2 | 2 | every field | 131 |
| `shader_stencil` | 2 | 2 | every field | 132 |
| `shared_creator_formats` | 2 | 2 | every field | 23 |
| `shared_events` | 2 | 2 | every field | 13 |
| `shared_exponent_storage` | 5 | 5 | every field | 42 |
| `simdgroup_lockstep` | 2 | 2 | every field | 25 |
| `snorm_tile_store` | 7 | 7 | 1 tolerance(s): `Degradation` | 114 |
| `snorm_tile_store` | 7 | 7 | 1 tolerance(s): `Degradation` | 115 |
| `sparse_heaps` | 6 | 6 | every field | 15 |
| `sparse_mappings` | 14 | 14 | every field | 32 |
| `sparse_tiles` | 4 | 4 | every field | 1 |
| `srgb_fetch` | 2 | 2 | every field | 130 |
| `srgb_fetch` | 2 | 2 | every field | 131 |
| `stage_in_regions` | 1 | 1 | every field | 48 |
| `stage_in_unread` | 1 | 1 | every field | 48 |
| `stencil_resolve_pairs` | 2 | 2 | every field | 132 |
| `stencil_resolved_sample` | 1 | 1 | every field | 132 |
| `stencil_resolve_pairs` | 2 | 2 | every field | 133 |
| `stencil_resolved_sample` | 1 | 1 | every field | 133 |
| `surface_fills` | 1 | 0 | every field | 0 |
| `surface_textures` | 10 | 10 | every field | 29 |
| `swizzled_storage` | 6 | 6 | every field | 43 |
| `tessellation_crossings` | 6 | 6 | every field | 102 |
| `tessellation_rendered` | 1 | 1 | every field | 118 |
| `tessellation_sweeps` | 7 | 7 | every field | 103 |
| `tessellation_crossings` | 6 | 6 | every field | 103 |
| `tessellation_rendered` | 1 | 1 | every field | 119 |
| `tessellation_sweeps` | 7 | 7 | every field | 104 |
| `texel_swizzles` | 6 | 6 | every field | 41 |
| `texture_accesses` | 1 | 1 | every field | 20 |
| `texture_buffer_fills` | 3 | 0 | every field | 0 |
| `texture_buffer_tails` | 1 | 1 | every field | 49 |
| `texture_descriptor_pairs` | 5 | 5 | 1 tolerance(s): `AcceptedDifference` | 27 |
| `texture_fills` | 54 | 2 | every field | 42 |
| `texture_view_casts` | 5 | 5 | every field | 77 |
| `texture_view_casts` | 5 | 5 | every field | 78 |
| `texture_views` | 4 | 4 | every field | 37 |
| `textures` | 76 | 76 | every field | 10 |
| `threadgroup_start` | 1 | 1 | every field | 24 |
| `tile_pipeline_descriptors` | 3 | 3 | every field | 31 |
| `tile_pipeline_reflection` | 1 | 1 | every field | 77 |
| `tile_threadgroups` | 8 | 8 | every field | 49 |
| `topology_classes` | 2 | 2 | every field | 113 |
| `topology_classes` | 2 | 2 | every field | 114 |
| `two_plane_copies` | 3 | 1 | every field | 42 |
| `two_plane_heap_blits` | 1 | 1 | every field | 40 |
| `two_plane_samples` | 16 | 16 | every field | 48 |
| `vector_word_phases` | 4 | 4 | every field | 23 |
| `vertex_attribute_strides` | 2 | 2 | every field | 102 |
| `vertex_constant_step` | 1 | 1 | every field | 103 |
| `vertex_fetch_reach` | 1 | 1 | every field | 103 |
| `vertex_formats` | 4 | 4 | every field | 102 |
| `vertex_step_rate` | 1 | 1 | every field | 102 |
| `visibility` | 16 | 16 | every field | 127 |
| `vertex_attribute_strides` | 2 | 2 | every field | 103 |
| `vertex_constant_step` | 1 | 1 | every field | 104 |
| `vertex_fetch_reach` | 1 | 1 | every field | 104 |
| `vertex_formats` | 4 | 4 | every field | 103 |
| `vertex_step_rate` | 1 | 1 | every field | 103 |
| `visibility` | 16 | 16 | every field | 128 |
| `visible_tables` | 18 | 18 | every field | 38 |
| `wide_int_attributes` | 2 | 2 | every field | 102 |
| `wide_points` | 1 | 1 | every field | 116 |
| `wide_int_attributes` | 2 | 2 | every field | 103 |
| `wide_points` | 1 | 1 | every field | 117 |
| `ycbcr_gathers` | 4 | 4 | every field | 50 |
| `ycbcr_minify` | 2 | 2 | every field | 50 |
| `ycbcr_textures` | 2 | 2 | 1 tolerance(s): `AcceptedDifference` | 39 |
@@ -1336,6 +1336,7 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| `depthAttachment` | yes | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`, `buffer_depth_samples`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `int_attributes`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `primitive_type_crossings`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_pass_descriptors`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `tessellation_crossings`, `tessellation_rendered`, `tessellation_sweeps`, `texture_view_casts`, `topology_classes`, `vertex_attribute_strides`, `vertex_constant_step`, `vertex_fetch_reach`, `vertex_formats`, `vertex_step_rate`, `visibility`, `wide_int_attributes`, `wide_points` | 381 |
| `stencilAttachment` | yes | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`, `buffer_depth_samples`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `int_attributes`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `primitive_type_crossings`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_pass_descriptors`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `tessellation_crossings`, `tessellation_rendered`, `tessellation_sweeps`, `texture_view_casts`, `topology_classes`, `vertex_attribute_strides`, `vertex_constant_step`, `vertex_fetch_reach`, `vertex_formats`, `vertex_step_rate`, `visibility`, `wide_int_attributes`, `wide_points` | 381 |
| `visibilityResultBuffer` | yes | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `int_attributes`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `primitive_type_crossings`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_pass_descriptors`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `tessellation_crossings`, `tessellation_rendered`, `tessellation_sweeps`, `texture_view_casts`, `topology_classes`, `vertex_attribute_strides`, `vertex_constant_step`, `vertex_fetch_reach`, `vertex_formats`, `vertex_step_rate`, `visibility`, `wide_int_attributes`, `wide_points` | 376 |
| `renderTargetArrayLength` | yes | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `int_attributes`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `primitive_type_crossings`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_pass_descriptors`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `tessellation_crossings`, `tessellation_rendered`, `tessellation_sweeps`, `texture_view_casts`, `topology_classes`, `vertex_attribute_strides`, `vertex_constant_step`, `vertex_fetch_reach`, `vertex_formats`, `vertex_step_rate`, `visibility`, `wide_int_attributes`, `wide_points` | 376 |
| `renderTargetWidth` | yes | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `int_attributes`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `primitive_type_crossings`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_pass_descriptors`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `tessellation_crossings`, `tessellation_rendered`, `tessellation_sweeps`, `texture_view_casts`, `topology_classes`, `vertex_attribute_strides`, `vertex_constant_step`, `vertex_fetch_reach`, `vertex_formats`, `vertex_step_rate`, `visibility`, `wide_int_attributes`, `wide_points` | 376 |
| `renderTargetHeight` | yes | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `int_attributes`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `primitive_type_crossings`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_pass_descriptors`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `tessellation_crossings`, `tessellation_rendered`, `tessellation_sweeps`, `texture_view_casts`, `topology_classes`, `vertex_attribute_strides`, `vertex_constant_step`, `vertex_fetch_reach`, `vertex_formats`, `vertex_step_rate`, `visibility`, `wide_int_attributes`, `wide_points` | 376 |
@@ -1921,7 +1922,6 @@ An item the suite's Metal leg calls whose coverage-map status is not implemented
| `MTLRenderPassDescriptor` `getSamplePositions:count:` | missing | programmable sample positions | `render_pass_descriptors` |
| `MTLRenderPassDescriptor` `imageblockSampleLength` | missing | a pass's imageblock memory, which tile functions use | `render_pass_descriptors` |
| `MTLRenderPassDescriptor` `rasterizationRateMap` | missing | rasterization rate maps | `render_pass_descriptors` |
| `MTLRenderPassDescriptor` `renderTargetArrayLength` | missing | layered rendering | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `int_attributes`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `primitive_type_crossings`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_pass_descriptors`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `tessellation_crossings`, `tessellation_rendered`, `tessellation_sweeps`, `texture_view_casts`, `topology_classes`, `vertex_attribute_strides`, `vertex_constant_step`, `vertex_fetch_reach`, `vertex_formats`, `vertex_step_rate`, `visibility`, `wide_int_attributes`, `wide_points` |
| `MTLRenderPassDescriptor` `setSamplePositions:count:` | missing | programmable sample positions | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `blit_indirect_commands`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `int_attributes`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `primitive_type_crossings`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_pass_descriptors`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `tessellation_crossings`, `tessellation_rendered`, `tessellation_sweeps`, `texture_view_casts`, `topology_classes`, `vertex_attribute_strides`, `vertex_constant_step`, `vertex_fetch_reach`, `vertex_formats`, `vertex_step_rate`, `visibility`, `wide_int_attributes`, `wide_points` |
| `MTLRenderPassDescriptor` `threadgroupMemoryLength` | missing | a pass's threadgroup memory, which tile functions use | `render_pass_descriptors` |
| `MTLRenderPassDescriptor` `tileHeight` | missing | tile render pipelines; metal2vulkan-runtime makes none | `render_pass_descriptors`, `tile_threadgroups` |
@@ -3244,7 +3244,6 @@ A case whose difference from Metal is recorded rather than compared away. The le
| `half-texel-nans-rgb9e5f` | The device's own answer (rule 1): a shared-exponent (`RGB9E5Float`) texel's channel below half's normal range through a `half` `read()` of a read-access texture… |
| `half-texel-nans-rgb9e5f` | The device's own answer (rule 1): a shared-exponent (`RGB9E5Float`) texel's channel below half's normal range through a `half` `read()` of a sample-access textu… |
| `half-texel-nans-rgb9e5f` | The device's own answer (rule 1): the shader's `float` widening of the `half` this case read, a shared-exponent texel's channel below half's normal range. Metal… |
| `layered-render-target-array-length` | refused: no stream uses it yet (states-only play 11-19, m3-max-56371-56373, 56375, player 44668b439f: 32 streams, every render and compute pipeline state made).… |
| `level-sizes-storage` | refused: no stream uses it yet (states-only play 11-19, m3-max-56371-56373, 56375, player 44668b439f: 32 streams, every render and compute pipeline state made).… |
| `math-frexp-ilogb-half` | The device's own answer (rule 1): `frexp`'s mantissa of the signalling `half` NaN 0x7c01: Metal keeps its bits; the device answers it quieted (0x7e01). Note `na… |
| `math-frexp-ilogb-half` | The device's own answer (rule 1): `frexp`'s mantissa of the signalling `half` NaN 0x7c01: Metal keeps its bits; the device answers it quieted (0x7e01). Note `na… |
+5 -5
View File
@@ -10,12 +10,12 @@ Every public item of the macOS 27.2 SDK (Xcode 27.2, 27B52)'s Metal headers, by
| Status | Items | Of which deprecated |
|---|---|---|
| implemented | 593 | 25 |
| missing | 1118 | 38 |
| implemented | 594 | 25 |
| missing | 1117 | 38 |
| out of scope | 424 | 5 |
| all | 2135 | 68 |
Implemented by the runtime: 237; by the translator's values: 356. Missing by size: S 191, M 209, L 342, XL 376.
Implemented by the runtime: 238; by the translator's values: 356. Missing by size: S 191, M 208, L 342, XL 376.
## Missing, in build order
@@ -32,7 +32,7 @@ Cheap items a plain app calls first, then medium pieces by how often a plain app
| plain-value constructors (`MTLOriginMake` and the rest) | S | 7 | `MTLOriginMake`, `MTLSizeMake`, `MTLRegionMake1D`, ... |
| a buffer made with bytes | S | 1 | `MTLDevice.newBufferWithBytes:length:options:` |
| pipeline creation forms (from a function, with a completion handler) | S | 6 | `MTLDevice.newRenderPipelineStateWithDescriptor:options:completionHandler:`, `MTLDevice.newComputePipelineStateWithFunction:error:`, `MTLDevice.newComputePipelineStateWithFunction:options:reflection:error:`, ... |
| render pass descriptor fields | S/M/L | 10 | `MTLRenderPassAttachmentDescriptor.depthPlane`, `MTLRenderPassAttachmentDescriptor.storeActionOptions`, `MTLRenderPassDescriptor.renderTargetArrayLength`, ... |
| render pass descriptor fields | S/M/L | 9 | `MTLRenderPassAttachmentDescriptor.depthPlane`, `MTLRenderPassAttachmentDescriptor.storeActionOptions`, `MTLRenderPassDescriptor.imageblockSampleLength`, ... |
| encoder calls (stride setters, indirect draws, store action options, a render encoder's resource and heap uses) | S/M/L | 36 | `MTLBlitCommandEncoder.synchronizeTexture:slice:level:`, `MTLBlitCommandEncoder.copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount:`, `MTLBlitCommandEncoder.copyFromTexture:toTexture:`, ... |
| `textureBarrier` and queue-stage barriers | S/M | 2 | `MTLCommandEncoder.barrierAfterQueueStages:beforeStages:`, `MTLRenderCommandEncoder.textureBarrier` |
| a pipeline state's reflection after creation | S | 2 | `MTLComputePipelineState.reflection`, `MTLRenderPipelineState.reflection` |
@@ -2179,7 +2179,7 @@ Cheap items a plain app calls first, then medium pieces by how often a plain app
| `MTLRenderPassDescriptor.depthAttachment` | property | implemented | `RenderPassDescriptor.depth_attachment` (runtime) |
| `MTLRenderPassDescriptor.stencilAttachment` | property | implemented | `RenderPassDescriptor.stencil_attachment` (runtime) |
| `MTLRenderPassDescriptor.visibilityResultBuffer` | property | implemented | `RenderPassDescriptor.visibility_result_buffer` (runtime) |
| `MTLRenderPassDescriptor.renderTargetArrayLength` | property | missing | M: layered rendering |
| `MTLRenderPassDescriptor.renderTargetArrayLength` | property | implemented | `RenderPassDescriptor.render_target_array_length` (runtime) |
| `MTLRenderPassDescriptor.imageblockSampleLength` | property | missing | M: a pass's imageblock memory, which tile functions use |
| `MTLRenderPassDescriptor.threadgroupMemoryLength` | property | missing | M: a pass's threadgroup memory, which tile functions use |
| `MTLRenderPassDescriptor.tileWidth` | property | missing | L: tile render pipelines; metal2vulkan-runtime makes none |
+4 -4
View File
@@ -324,7 +324,7 @@ Columns:
| `AttachmentUsage` | A render pass attachment (`CommandBuffer::render_command_encoder`) whose texture was made without `RenderTarget` usage | every device (a public call's own check of its arguments) | `metal-documented`: a texture a render pass renders into needs `MTLTextureUsageRenderTarget`; Metal's validation stops the descriptor | 1: `crates/metal2vulkan-runtime/src/texture.rs (attachment)` | `-` |
| `ResolveTexture` | A store action that resolves (`MultisampleResolve` or `StoreAndMultisampleResolve`), on a render pass attachment or set by its encoder, for an... | every device (a public call's own check of its arguments) | `metal-documented`: `MTLRenderPass.h`: `resolveTexture` is "Only used (and required) if the store action is set to MTLStoreActionMultisampleResolve" | 2: `crates/metal2vulkan-runtime/src/pass.rs (resolving)`, `crates/metal2vulkan-runtime/src/render_encoder.rs (later_store)` | `-` |
| `ResolveFormat` | A resolve of a render pass color attachment of an integer pixel format | every device (a public call's own check of its arguments) | `metal-documented`: Metal's validation asserts that an integer color format "cannot be a MSAA resolve target", and plain Metal writes values no sample holds | 1: `crates/metal2vulkan-runtime/src/pass.rs (check)` | `-` |
| `AttachmentPlace` | A render pass attachment of a level or slice past its texture's | every device (a public call's own check of its arguments) | `ours`: no texel of the texture is there to render into | 1: `crates/metal2vulkan-runtime/src/texture.rs (attachment_view)` | `-` |
| `AttachmentPlace` | A render pass attachment or resolve texture of a level or slice past its texture's | every device (a public call's own check of its arguments) | `ours`: no texel of the texture is there to render into | 2: `crates/metal2vulkan-runtime/src/texture.rs (attachment_view, 2 sites)` | `-` |
| `AttachmentFormat` | A render pass color attachment of a depth or stencil pixel format, a depth attachment of a format without depth, or a stencil attachment of a... | every device (a public call's own check of its arguments) | `metal-documented`: a color attachment takes a color-renderable format, a depth attachment a format with depth and a stencil attachment a format with stencil; Metal's validation stops the descriptor | 3: `crates/metal2vulkan-runtime/src/pass.rs (check, 3 sites)` | `-` |
| `VertexBufferOffset` | A draw whose vertex descriptor reads a vertex buffer at an offset at or past the buffer's length | every device (a public call's own check of its arguments) | `metal-documented`: a buffer's offset lies inside it; Metal's validation stops the bind | 1: `crates/metal2vulkan-runtime/src/render_encoder.rs (find)` | `-` |
| `IndexBufferOffset` | An indexed draw whose index buffer offset is not a multiple of the index size, or whose indices leave the buffer | every device (a public call's own check of its arguments) | `metal-documented`: the offset is a multiple of the index size and the indices lie in the buffer; Metal's validation stops the draw | 1: `crates/metal2vulkan-runtime/src/render_encoder.rs (draw)` | `-` |
@@ -387,7 +387,7 @@ Columns:
| `BicubicTexels` | A dispatch or a draw whose function samples texture slot `slot` through a constexpr sampler with Metal's bicubic filter (`filter::bicubic`), where... | every device (a public call's own check of its arguments) | `ours`: each refused format's treatment is built when a guest binds one | 2: `crates/metal2vulkan-runtime/src/encoder.rs (dispatch)`, `crates/metal2vulkan-runtime/src/render_encoder.rs (find)` | `-` |
| `TextureView` | `Texture::new_texture_view` of a kind Metal makes and the runtime does not build | every device (a public call's own check of its arguments) | `ours`: the replay streams' views that compute binds are same-format views of every slice, 2D views of one slice of a 2D array, and level subranges, swizzled or not; each other kind is built when a replay stream binds one | 1: `crates/metal2vulkan-runtime/src/texture.rs (view)` | `-` |
| `RenderPass` | A render pass of something the runtime does not build yet (`CommandBuffer::render_command_encoder`) | every device (a public call's own check of its arguments) | `ours`: the replay streams' passes render into one to two color attachments and a stencil or a depth attachment, each a level of a 2D texture of one sample, with no resolve and a clear depth of 1, none naming two textures for its depth and stencil; each other kind is built when a replay stream makes one; `DepthStencilViews` and `ClearDepth` are what Vulkan's rendering under the floor takes no form of | 6: `crates/metal2vulkan-runtime/src/pass.rs (check)`, `crates/metal2vulkan-runtime/src/pass.rs (ops)` (+4) | `-` |
| `Draw` | A draw or render encoder state the runtime does not build yet (`RenderCommandEncoder`) | every device (a public call's own check of its arguments) | `ours`: the replay streams draw lines and triangles through one viewport Vulkan's is, with pipeline states of their pass's formats, under depth biases with no clamp, filled and clipped; each other kind is built when a replay stream draws one), and device for [`DrawKind::DividedBaseInstance`] (a device that does not report `supportsNonZeroFirstInstance` | 12: `crates/metal2vulkan-runtime/src/render_encoder.rs (attachment_reads, 2 sites)`, `crates/metal2vulkan-runtime/src/render_encoder.rs (draw)` (+9) | `-` |
| `Draw` | A draw or render encoder state the runtime does not build yet (`RenderCommandEncoder`) | every device (a public call's own check of its arguments) | `ours`: the replay streams draw lines and triangles through one viewport Vulkan's is, with pipeline states of their pass's formats, under depth biases with no clamp, filled and clipped; each other kind is built when a replay stream draws one), and device for [`DrawKind::DividedBaseInstance`] (a device that does not report `supportsNonZeroFirstInstance` | 13: `crates/metal2vulkan-runtime/src/render_encoder.rs (attachment_reads, 3 sites)`, `crates/metal2vulkan-runtime/src/render_encoder.rs (draw)` (+9) | `-` |
| `LinearPlanePass` | A render pass over a surface plane that renders as a linear colour attachment alone, in a shape the device does not render... | at the device's limit | `device`: VK_NV_linear_color_attachment renders such a format as a colour attachment only "as long as all the color attachments in the render pass instance have VK_IMAGE_TILING_LINEAR tiling"; the RTX 3090's driver lost the device rendering a linear colour attachment beside a depth or stencil attachment | 1: `crates/metal2vulkan-runtime/src/pass.rs (check)` | `-` |
## Appendix: every site
@@ -619,7 +619,7 @@ Each refusal's sites, with the function that builds it.
- `rt:Refusal::AttachmentUsage`: `crates/metal2vulkan-runtime/src/texture.rs (attachment)`
- `rt:Refusal::ResolveTexture`: `crates/metal2vulkan-runtime/src/pass.rs (resolving)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (later_store)`
- `rt:Refusal::ResolveFormat`: `crates/metal2vulkan-runtime/src/pass.rs (check)`
- `rt:Refusal::AttachmentPlace`: `crates/metal2vulkan-runtime/src/texture.rs (attachment_view)`
- `rt:Refusal::AttachmentPlace`: `crates/metal2vulkan-runtime/src/texture.rs (attachment_view, 2 sites)`
- `rt:Refusal::AttachmentFormat`: `crates/metal2vulkan-runtime/src/pass.rs (check, 3 sites)`
- `rt:Refusal::VertexBufferOffset`: `crates/metal2vulkan-runtime/src/render_encoder.rs (find)`
- `rt:Refusal::IndexBufferOffset`: `crates/metal2vulkan-runtime/src/render_encoder.rs (draw)`
@@ -672,6 +672,6 @@ Each refusal's sites, with the function that builds it.
- `rt:Gap::BicubicTexels`: `crates/metal2vulkan-runtime/src/encoder.rs (dispatch)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (find)`
- `rt:Gap::TextureView`: `crates/metal2vulkan-runtime/src/texture.rs (view)`
- `rt:Gap::RenderPass`: `crates/metal2vulkan-runtime/src/pass.rs (check)`; `crates/metal2vulkan-runtime/src/pass.rs (ops)`; `crates/metal2vulkan-runtime/src/pass.rs (resolve)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (later_store)`; `crates/metal2vulkan-runtime/src/texture.rs (attachment_view)`; `crates/metal2vulkan-runtime/src/texture.rs (resolve_attachment)`
- `rt:Gap::Draw`: `crates/metal2vulkan-runtime/src/render_encoder.rs (attachment_reads, 2 sites)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (draw)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (draw_patches)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_depth_bias)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_depth_clip_mode)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_scissor_rects)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_triangle_fill_mode)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_viewport)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_viewports)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_visibility_result_mode)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (shadow_copies)`
- `rt:Gap::Draw`: `crates/metal2vulkan-runtime/src/render_encoder.rs (attachment_reads, 3 sites)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (draw)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (draw_patches)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_depth_bias)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_depth_clip_mode)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_scissor_rects)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_triangle_fill_mode)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_viewport)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_viewports)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (set_visibility_result_mode)`; `crates/metal2vulkan-runtime/src/render_encoder.rs (shadow_copies)`
- `rt:Gap::LinearPlanePass`: `crates/metal2vulkan-runtime/src/pass.rs (check)`
+1 -1
View File
@@ -1718,7 +1718,7 @@ MTLRenderPass.h MTLRenderPassDescriptor property colorAttachments I runtime Ren
MTLRenderPass.h MTLRenderPassDescriptor property depthAttachment I runtime RenderPassDescriptor.depth_attachment
MTLRenderPass.h MTLRenderPassDescriptor property stencilAttachment I runtime RenderPassDescriptor.stencil_attachment
MTLRenderPass.h MTLRenderPassDescriptor property visibilityResultBuffer I runtime RenderPassDescriptor.visibility_result_buffer
MTLRenderPass.h MTLRenderPassDescriptor property renderTargetArrayLength M layered rendering M render-pass
MTLRenderPass.h MTLRenderPassDescriptor property renderTargetArrayLength I runtime RenderPassDescriptor.render_target_array_length
MTLRenderPass.h MTLRenderPassDescriptor property imageblockSampleLength M a pass's imageblock memory, which tile functions use M render-pass
MTLRenderPass.h MTLRenderPassDescriptor property threadgroupMemoryLength M a pass's threadgroup memory, which tile functions use M render-pass
MTLRenderPass.h MTLRenderPassDescriptor property tileWidth M tile render pipelines; metal2vulkan-runtime makes none L tile
1 header container kind name deprecated status crate counterpart note size group
1718 MTLRenderPass.h MTLRenderPassDescriptor property depthAttachment I runtime RenderPassDescriptor.depth_attachment
1719 MTLRenderPass.h MTLRenderPassDescriptor property stencilAttachment I runtime RenderPassDescriptor.stencil_attachment
1720 MTLRenderPass.h MTLRenderPassDescriptor property visibilityResultBuffer I runtime RenderPassDescriptor.visibility_result_buffer
1721 MTLRenderPass.h MTLRenderPassDescriptor property renderTargetArrayLength M I runtime RenderPassDescriptor.render_target_array_length layered rendering M render-pass
1722 MTLRenderPass.h MTLRenderPassDescriptor property imageblockSampleLength M a pass's imageblock memory, which tile functions use M render-pass
1723 MTLRenderPass.h MTLRenderPassDescriptor property threadgroupMemoryLength M a pass's threadgroup memory, which tile functions use M render-pass
1724 MTLRenderPass.h MTLRenderPassDescriptor property tileWidth M tile render pipelines; metal2vulkan-runtime makes none L tile
@@ -128,7 +128,8 @@ RUNTIME_FLOOR = {
"shaderStorageImageArrayNonUniformIndexing", "samplerMirrorClampToEdge",
"shaderInt8", "storageBuffer8BitAccess", "scalarBlockLayout",
"uniformBufferStandardLayout", "vulkanMemoryModel", "vulkanMemoryModelDeviceScope",
"shaderSubgroupExtendedTypes", "timelineSemaphore", "hostQueryReset")},
"shaderSubgroupExtendedTypes", "timelineSemaphore", "hostQueryReset",
"shaderOutputLayer")},
"VkPhysicalDeviceVulkan13Features": {member: True for member in (
"subgroupSizeControl", "computeFullSubgroups", "robustImageAccess",
"shaderDemoteToHelperInvocation", "shaderTerminateInvocation",