rt: a fragment function's stencil output is the device's own where it lists the export
A fragment function's `[[stencil]]` output is the fragment's stencil reference, which Metal's
stencil test and its Replace operations take (Metal's feature set tables give stencil feedback to
the Apple5 family and later and to Metal 3 and Metal 4). rt enabled VK_EXT_shader_stencil_export
on no device, so the translator refused every such function (`StencilExport`): under the
identity domains its pixel-interlock form is never chosen (lower::fragment::fetch::interlock_forms).
floor: VK_EXT_shader_stencil_export joins OPTIONAL_EXTENSIONS, enabled where the device lists it,
and its name reaches the translator's profile (shader_extension), whose fragment stage then
writes `FragStencilRefEXT`, the one form there. A device that does not list it keeps the typed
refusal, naming StencilExport: no answer chooses a second form.
Venues (the supported device extension list of each vulkaninfo dump, read as JSON): RADV on the
RX 7900 XTX, every 780M and the RX 550, ANV on the Iris Xe, lavapipe, KosmicKrisp on the M3 Max
and the UHD 630's Windows driver list it (m3-max-48727 to 48731, 48736, 48737 and 61508); NVIDIA's
620.70.06 on the RTX 2080 and RTX 3090 and 615.71.09 on the RTX 5080 Laptop do not (48727, 48729,
48731).
Docs: the runtime README's extension table, the render pipeline states' refusal line, and a
known gap for a device without the export. REFUSALS regenerated: no change. The public signature
table holds floor::OPTIONAL_EXTENSIONS' value, which gains the extension; no signature moved.
Ledger: stencil-output and stencil-output-loaded move from every venue to NVIDIA, where they
still refuse naming StencilExport. pass-sequence-aspect-actions keeps that row on NVIDIA and,
where the export is listed, refuses one step later as a state with DepthStencilFormats: rows for
llvmpipe and RADV (verified) and for Iris(R) Xe, UHD Graphics 630 and Apple M3 Max (expected
from their extension lists). CONFORMANCE-COVERAGE.md regenerated (7692 ledger rows).
Test: tests::stencil_export on every device of the cfg's kind: where the device lists the
extension, Device::extensions names it, the translator's profile has it, and a draw of
stx_stencil_by_pixel under a Replace depth-stencil state stores each pixel's output's low 8 bits
(two of every three outputs carry higher bits) in the Stencil8 attachment; elsewhere the state is
refused naming StencilExport. floor's an_optional_extension_is_enabled_where_listed and the
README's table test take the list as it is.
Evidence, at 6e1004de4d and 149a5296e7 (earlier forms of this commit):
- The 16 public cases (valexec2's E/F/G proof m3-max-61598): before, at f3418eacb9 on lavapipe
(m3-max-61725), not_supported naming StencilExport; after, at 6e1004de4d, 16/16 match on
runtime-render (m3-max-61732).
- Conformance on lavapipe at 149a5296e7 (m3-max-61812, ms01): every stencil row as the ledger
says; its one other line, blend-interaction-format-srgb8 divergent on LLVM 23.1.4, is that
lavapipe's blend and no stencil case. At 6e1004de4d: RTX 3090 (m3-max-61739) exactly the
ledger's NVIDIA rows; RX 7900 XTX (m3-max-61740) the three rows as this ledger states them.
- The device test at 149a5296e7: lavapipe passes (61812); RX 7900 XTX, 64 pixels stored their
output (m3-max-61859); RTX 3090, refused naming StencilExport (m3-max-61860).
This commit is contained in:
1 parent
5f5d3ea455
commit
afd9686408
7 files changed
+150
-11
No files matched your search
@@ -1295,7 +1295,12 @@ pass-bytes-srgb-encode-sweep RX 7900 XTX divergent case/output/words 772 element
|
||||
pass-bytes-srgb-encode-sweep Iris(R) Xe divergent case/output/words 772 elements differ (U32), the largest difference 65793 The device's own answer (rule 1): the device's sRGB encode lands one code from Metal's (Metal 0x20201, ours 0x20101 at the first differing element). Note `device-pack-conversion`.
|
||||
pass-bytes-srgb-encode-sweep NVIDIA divergent case/output/words 772 elements differ (U32), the largest difference 65793 The device's own answer (rule 1): the device's sRGB encode lands one code from Metal's (Metal 0x20201, ours 0x20101 at the first differing element). Note `device-pack-conversion`.
|
||||
pass-bytes-srgb-encode-sweep RX 550 divergent case/output/words 772 elements differ (U32), the largest difference 65793 The device's own answer (rule 1): the device's sRGB encode lands one code from Metal's (Metal 0x20201, ours 0x20101 at the first differing element). Note `device-pack-conversion`.
|
||||
pass-sequence-aspect-actions * refused case/pipeline Err(Error::Translation("the translator made no pipeline: unsupported: StencilExport; needs AnyOf([[Extension(ExtShaderStencilExport)], [Feature(FragmentShaderPixelInterlock)]]) at metadata of entry stx_stencil_with_depth")) 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 (StencilExport: a fragment function that writes stencil, which needs VK_EXT_shader_stencil_export or fragment shader interlock rt does not enable); rt README, Known gaps of pipeline states.
|
||||
pass-sequence-aspect-actions NVIDIA refused case/pipeline Err(Error::Translation("the translator made no pipeline: unsupported: StencilExport; needs AnyOf([[Extension(ExtShaderStencilExport)], [Feature(FragmentShaderPixelInterlock)]]) at metadata of entry stx_stencil_with_depth")) 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 (StencilExport: a fragment function that writes stencil needs VK_EXT_shader_stencil_export, which NVIDIA's drivers do not list; under the identity domains the pixel interlock chooses no other form); rt README, Known gaps of pipeline states.
|
||||
pass-sequence-aspect-actions llvmpipe refused case/pipeline Err(Error::Unsupported("a render pipeline state with DepthStencilFormats is not built")) 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). rt builds no render pipeline state with DepthStencilFormats (Gap::RenderPipeline; rt README, Known gaps of render pipeline states).
|
||||
pass-sequence-aspect-actions RADV refused case/pipeline Err(Error::Unsupported("a render pipeline state with DepthStencilFormats is not built")) 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). rt builds no render pipeline state with DepthStencilFormats (Gap::RenderPipeline; rt README, Known gaps of render pipeline states).
|
||||
pass-sequence-aspect-actions Iris(R) Xe refused case/pipeline Err(Error::Unsupported("a render pipeline state with DepthStencilFormats is not built")) 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). rt builds no render pipeline state with DepthStencilFormats (Gap::RenderPipeline; rt README, Known gaps of render pipeline states).
|
||||
pass-sequence-aspect-actions UHD Graphics 630 refused case/pipeline Err(Error::Unsupported("a render pipeline state with DepthStencilFormats is not built")) 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). rt builds no render pipeline state with DepthStencilFormats (Gap::RenderPipeline; rt README, Known gaps of render pipeline states).
|
||||
pass-sequence-aspect-actions Apple M3 Max refused case/pipeline Err(Error::Unsupported("a render pipeline state with DepthStencilFormats is not built")) 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). rt builds no render pipeline state with DepthStencilFormats (Gap::RenderPipeline; rt README, Known gaps of render pipeline states).
|
||||
pass-start-barrier-new-texture-chain RX 550 refused case/pieces/2-renderCommandEncoder Err(Error::Unsupported("a draw with AttachmentRead is not built")) rt's own gap, not the device's: the pass reads, at its own pixels, its target, a texture over a buffer, and where the device's linear image lies at the buffer's pitch that texture is a linear image on the buffer's memory (rule 3's form), which rt gives no attachment read, neither the feedback usage nor a shadow (texture.rs: only an image a texture's own plan makes takes them), so the draw is Gap::Draw (AttachmentRead). Expected from the code and the venues' pattern, not shown by a counter: the 32-texel targets (128-byte rows) refuse on lavapipe and the Iris Xe and are read on the Radeon 780M, the 896-texel one (3,584-byte rows) refuses on all three, and the RTX 3090 reads both (53452, 53559).
|
||||
pipeline-options-compute-binding-info-and-undefined-bit * refused case/outcome Err(TheConsumers("metal2vulkan-runtime builds no pipeline reflection and acts on no MTLPipelineOption (FailOnBinaryArchiveMiss, ArgumentInfo, BufferTypeInfo, BindingInfo): its consumer builds reflection from the library's AIR")) refused: the consumer's own (MTLComputePipelineReflection, MTLRenderPipelineReflection, MTLPipelineOptionFailOnBinaryArchiveMiss, MTLPipelineOptionArgumentInfo, MTLPipelineOptionBufferTypeInfo, MTLPipelineOptionBindingInfo). rt builds no reflection and acts on no pipeline option; its consumer builds reflection from the library's AIR.
|
||||
pipeline-options-compute-undefined-bit-3 * refused case/outcome Err(TheConsumers("metal2vulkan-runtime builds no pipeline reflection and acts on no MTLPipelineOption (FailOnBinaryArchiveMiss, ArgumentInfo, BufferTypeInfo, BindingInfo): its consumer builds reflection from the library's AIR")) refused: the consumer's own (MTLComputePipelineReflection, MTLRenderPipelineReflection, MTLPipelineOptionFailOnBinaryArchiveMiss, MTLPipelineOptionArgumentInfo, MTLPipelineOptionBufferTypeInfo, MTLPipelineOptionBindingInfo). rt builds no reflection and acts on no pipeline option; its consumer builds reflection from the library's AIR.
|
||||
@@ -1886,8 +1891,8 @@ shared-exponent-update-float RX 550 refused case/fpv_srgb_update/dispatch Err(Er
|
||||
shared-exponent-update-half RX 550 refused case/fpv_srgb_update_half/dispatch Err(Error::Unsupported("texture slot 0, which a function writes or reads as storage, bound to a RGB9E5Float texture with no storage element on this device, or one it cannot read without a format, is not built")) The device's own answer (rule 2): this device's format queries offer no storage image of MTLPixelFormatRGB9E5Float, so rt binds no such texture to a read_write or write slot.
|
||||
shared-exponent-write-float RX 550 refused case/fpv_srgb_write/dispatch Err(Error::Unsupported("texture slot 0, which a function writes or reads as storage, bound to a RGB9E5Float texture with no storage element on this device, or one it cannot read without a format, is not built")) The device's own answer (rule 2): this device's format queries offer no storage image of MTLPixelFormatRGB9E5Float, so rt binds no such texture to a read_write or write slot.
|
||||
shared-exponent-write-half RX 550 refused case/fpv_srgb_write_half/dispatch Err(Error::Unsupported("texture slot 0, which a function writes or reads as storage, bound to a RGB9E5Float texture with no storage element on this device, or one it cannot read without a format, is not built")) The device's own answer (rule 2): this device's format queries offer no storage image of MTLPixelFormatRGB9E5Float, so rt binds no such texture to a read_write or write slot.
|
||||
stencil-output * refused case/pipeline/output Err(Error::Translation("the translator made no pipeline: unsupported: StencilExport; needs AnyOf([[Extension(ExtShaderStencilExport)], [Feature(FragmentShaderPixelInterlock)]]) at metadata of entry stx_stencil_by_pixel")) 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 (StencilExport: a fragment function that writes stencil, which needs VK_EXT_shader_stencil_export or fragment shader interlock rt does not enable); rt README, Known gaps of pipeline states.
|
||||
stencil-output-loaded * refused case/pipeline/output Err(Error::Translation("the translator made no pipeline: unsupported: StencilExport; needs AnyOf([[Extension(ExtShaderStencilExport)], [Feature(FragmentShaderPixelInterlock)]]) at metadata of entry stx_stencil_by_pixel")) 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 (StencilExport: a fragment function that writes stencil, which needs VK_EXT_shader_stencil_export or fragment shader interlock rt does not enable); rt README, Known gaps of pipeline states.
|
||||
stencil-output NVIDIA refused case/pipeline/output Err(Error::Translation("the translator made no pipeline: unsupported: StencilExport; needs AnyOf([[Extension(ExtShaderStencilExport)], [Feature(FragmentShaderPixelInterlock)]]) at metadata of entry stx_stencil_by_pixel")) 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 (StencilExport: a fragment function that writes stencil needs VK_EXT_shader_stencil_export, which NVIDIA's drivers do not list; under the identity domains the pixel interlock chooses no other form); rt README, Known gaps of pipeline states.
|
||||
stencil-output-loaded NVIDIA refused case/pipeline/output Err(Error::Translation("the translator made no pipeline: unsupported: StencilExport; needs AnyOf([[Extension(ExtShaderStencilExport)], [Feature(FragmentShaderPixelInterlock)]]) at metadata of entry stx_stencil_by_pixel")) 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 (StencilExport: a fragment function that writes stencil needs VK_EXT_shader_stencil_export, which NVIDIA's drivers do not list; under the identity domains the pixel interlock chooses no other form); rt README, Known gaps of pipeline states.
|
||||
surface-fills-over-planes-and-buffers * refused case/500/b4/texture Err(Unavailable({call: "newTextureWithDescriptor:iosurface:plane: of a two-plane YCbCr format"})) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no texture descriptor of a pixel format above 260, so none of Metal's two-plane YCbCr formats, 500 on). A texture of a two-plane YCbCr format over a surface's planes, which converts both planes' codes as it reads; rt has no texture of one, and the replay streams' surface textures are of ordinary formats (surface_textures).
|
||||
surface-textures-420v-chroma-rg8 NVIDIA refused case/replace-region Err(Error::Refused("the CPU reaches no Private or Memoryless texture")) rt's own gap: this device lays the case's two-plane surface in place under neither the dma-buf nor the opaque fd (53626: 0 in place, 2 copied), so the surface takes the copy form, in which a plane's texture is a texture over a buffer in the exported block, whose memory is Private, and rt refuses the CPU's replaceRegion: of it; Metal's texture over an IOSurface plane takes the CPU's write. The one-plane cases are in place here and compare. Why each handle took the copy form (SurfaceCopy) this run does not record.
|
||||
surface-textures-420v-luma-r8 NVIDIA refused case/replace-region Err(Error::Refused("the CPU reaches no Private or Memoryless texture")) rt's own gap: this device lays the case's two-plane surface in place under neither the dma-buf nor the opaque fd (53626: 0 in place, 2 copied), so the surface takes the copy form, in which a plane's texture is a texture over a buffer in the exported block, whose memory is Private, and rt refuses the CPU's replaceRegion: of it; Metal's texture over an IOSurface plane takes the CPU's write. The one-plane cases are in place here and compare. Why each handle took the copy form (SurfaceCopy) this run does not record.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2854,14 +2854,22 @@ or does not check is rebuilt from the generations' names, with young counted ful
|
||||
step function or enabled factor scale (`Tessellation`;
|
||||
a descriptor's tessellation state with any other vertex function is ignored, as Metal ignores it),
|
||||
stages the translator synthesizes beside the functions' and a tessellation's, an imageblock, a
|
||||
fragment function's stencil output, a specialization other than the sample and amplification
|
||||
counts, dynamic state beyond Vulkan 1.3's (a vertex buffer layout whose stride is set per bind
|
||||
among it), a feature or extension device creation does not enable, and a function that reads
|
||||
what a draw does not supply (`DrawInput`: a function table, a table the binder builds, a
|
||||
parameter block past the push range, a push field or bind-time fact the encoder does not fill,
|
||||
fragment function's stencil output applied by the function itself (`ShaderStencil`, a form the
|
||||
translator does not choose under the identity domains), a specialization other than the sample and
|
||||
amplification counts, dynamic state beyond Vulkan 1.3's (a vertex buffer layout whose stride is
|
||||
set per bind among it), a feature or extension device creation does not enable, and a function
|
||||
that reads what a draw does not supply (`DrawInput`: a function table, a table the binder builds,
|
||||
a parameter block past the push range, a push field or bind-time fact the encoder does not fill,
|
||||
an unnormalized constexpr sampler). Of the replay streams' contents that translate, every one
|
||||
reads only its slots' addresses, resource IDs and constexpr sampler indices. A state for indirect
|
||||
command buffers is `Gap::IndirectCommandBuffers`. The `completionHandler:` forms are not built.
|
||||
- On a device that does not list `VK_EXT_shader_stencil_export`, a fragment function's `[[stencil]]`
|
||||
output is refused at creation, an `Error::Translation` naming `StencilExport`: under the identity
|
||||
domains the pixel interlock chooses no other form. Metal's feature set tables give stencil
|
||||
feedback to the Apple5 family and later and to Metal 3 and Metal 4. NVIDIA's 615 and 620 drivers
|
||||
on the RTX 2080, RTX 3090 and RTX 5080 Laptop list none (`vulkaninfo`, jobs m3-max-48727, 48729
|
||||
and 48731); RADV on the RX 7900 XTX, the 780Ms and the RX 550, ANV on the Iris Xe, lavapipe,
|
||||
KosmicKrisp and the UHD 630's Windows driver list it (48727 to 48731, 48736, 48737 and 61508).
|
||||
- On a device without `shaderQuadControl` (Quad control, under Floor), a fragment function whose
|
||||
group operations read, combine or count other lanes (every SIMD-group and quad group function, and
|
||||
the SIMD-group matrix functions) is refused at creation, an `Error::Translation` naming
|
||||
@@ -3512,6 +3520,7 @@ Presenting runs on the runtime's own device; nothing is exported or imported.
|
||||
| `VK_KHR_shader_subgroup_uniform_control_flow` | device, where listed | SIMD groups' reconvergence where maximal reconvergence is not offered |
|
||||
| `VK_KHR_shader_quad_control` | device, where listed | a fragment function's group operations over other lanes, through the quad-control feature below |
|
||||
| `VK_EXT_fragment_shader_interlock` | device, where listed | a fragment function's raster order groups on memory it reads and writes, through the pixel-interlock feature below |
|
||||
| `VK_EXT_shader_stencil_export` | device, where listed | a fragment function's `[[stencil]]` output as the fragment's stencil reference (`FragStencilRefEXT`); RADV, ANV, lavapipe, KosmicKrisp and the UHD 630's Windows driver list it, NVIDIA's 615 and 620 drivers do not |
|
||||
| `VK_KHR_portability_enumeration` | instance, where offered | listing portability devices, each checked against the floor as any other |
|
||||
| `VK_KHR_portability_subset` | device, where listed | Vulkan requires it enabled where a device lists it; the device is asked for the portability features below |
|
||||
| `VK_EXT_attachment_feedback_loop_layout` | device, with the feedback loop | a draw's read of an attachment of its own pass through a texture, in the feedback layout (below) |
|
||||
|
||||
@@ -42,7 +42,8 @@ pub const TIME_DOMAINS: [vk::TimeDomainKHR; 2] =
|
||||
/// The device extensions device creation enables where the device lists them: the SIMD groups'
|
||||
/// reconvergence modes, each for the optional features of its own, quad control and the fragment
|
||||
/// shader interlock, for `shaderQuadControl` and `fragmentShaderPixelInterlock` where the device
|
||||
/// reports them, the portability subset, which
|
||||
/// reports them, the shader stencil export, through which a fragment function's `[[stencil]]`
|
||||
/// output is the fragment's stencil reference (`FragStencilRefEXT`), the portability subset, which
|
||||
/// Vulkan requires enabled where a device lists it, with the portability features the floor asks
|
||||
/// of such a device, the vertex attribute divisor's two extensions, for the step-rate feature
|
||||
/// of their own: the KHR, and the EXT it was promoted from, whose feature and pipeline structures
|
||||
@@ -61,6 +62,7 @@ pub const OPTIONAL_EXTENSIONS: &[&CStr] = &[
|
||||
ash::khr::shader_subgroup_uniform_control_flow::NAME,
|
||||
ash::khr::shader_quad_control::NAME,
|
||||
ash::ext::fragment_shader_interlock::NAME,
|
||||
ash::ext::shader_stencil_export::NAME,
|
||||
ash::khr::portability_subset::NAME,
|
||||
ash::khr::vertex_attribute_divisor::NAME,
|
||||
ash::ext::vertex_attribute_divisor::NAME,
|
||||
@@ -121,6 +123,8 @@ fn shader_extension(name: &CStr) -> Option<VkExtension> {
|
||||
Some(VkExtension::ExtFragmentShaderInterlock)
|
||||
} else if name == ash::khr::fragment_shader_barycentric::NAME {
|
||||
Some(VkExtension::KhrFragmentShaderBarycentric)
|
||||
} else if name == ash::ext::shader_stencil_export::NAME {
|
||||
Some(VkExtension::ExtShaderStencilExport)
|
||||
} else if name == ash::ext::robustness2::NAME {
|
||||
Some(VkExtension::ExtRobustness2)
|
||||
} else if name == ash::khr::portability_subset::NAME {
|
||||
|
||||
@@ -84,6 +84,7 @@ mod staging;
|
||||
#[cfg(m2v_gpu)]
|
||||
mod stamps;
|
||||
mod state_answers;
|
||||
mod stencil_export;
|
||||
mod storage_element;
|
||||
mod subgroup_sizes;
|
||||
mod submit_infos;
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
//! A fragment function's `[[stencil]]` output (`floor`'s `OPTIONAL_EXTENSIONS`), under a device cfg
|
||||
//! on every device of the cfg's kind: where the device lists `VK_EXT_shader_stencil_export`,
|
||||
//! device creation enables it, the translator's profile has it, the state is made, and a draw
|
||||
//! whose depth-stencil state replaces the stencil stores each fragment's output, its low 8 bits as
|
||||
//! Metal takes them, at every pixel; elsewhere the device names no such extension and creation
|
||||
//! refuses the state naming `StencilExport`, the pixel interlock choosing no other form under the
|
||||
//! identity domains.
|
||||
//!
|
||||
//! `colored_vertex` (the runtime's examples) draws the fullscreen triangle; `stx_stencil_by_pixel`
|
||||
//! (engine `stx_stencil`) returns word `y * width + x` of its buffer 0 at pixel `(x, y)`.
|
||||
//!
|
||||
//! `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::{
|
||||
descriptor, examples, library, pass, read, run, target, vertices, Buffers, SIDE,
|
||||
};
|
||||
use crate::texture::TextureObject;
|
||||
use crate::{
|
||||
DepthStencilDescriptor, Error, FunctionDescriptor, PixelFormat, PrimitiveType, StageSource,
|
||||
StencilOperation, TextureUsage,
|
||||
};
|
||||
use metal2vulkan::error::Feature;
|
||||
use metal2vulkan_devtools::engine_dir;
|
||||
|
||||
/// The word pixel `i` (row-major) of the fragment function's buffer returns: bits above the
|
||||
/// low 8 on two of every three pixels, which Metal's stencil reference drops.
|
||||
fn value(i: u32) -> u32 {
|
||||
0x100 * (i % 3) + (i * 29 + 7) % 256
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_device_stores_a_fragment_functions_stencil_output_where_it_lists_the_export() {
|
||||
let Some(examples) = examples() else {
|
||||
return;
|
||||
};
|
||||
let Some(stencils) = library(&engine_dir().join("stx_stencil.ll")) else {
|
||||
return;
|
||||
};
|
||||
let mut d = descriptor(&examples, "colored_fragment", PixelFormat::RGBA8Unorm);
|
||||
d.fragment = Some(StageSource::Function(FunctionDescriptor::new(
|
||||
stencils
|
||||
.function("stx_stencil_by_pixel")
|
||||
.expect("the function"),
|
||||
)));
|
||||
d.stencil_format = Some(PixelFormat::Stencil8);
|
||||
each_device("stencil_export", |name, _, device| {
|
||||
let export = ash::ext::shader_stencil_export::NAME;
|
||||
let listed = device.extensions().iter().any(|e| e.as_c_str() == export);
|
||||
let profile = device.core().translator.profile().fragment().stencil_export;
|
||||
assert_eq!(profile, listed, "{name}: the translator's stencil export");
|
||||
let made = device.new_render_pipeline_state(&d, crate::tests::no_constexpr_samplers);
|
||||
let state = match (listed, made) {
|
||||
(true, Ok(state)) => state,
|
||||
(true, Err(error)) => panic!("{name}: {error}"),
|
||||
(false, Ok(_)) => panic!("{name}: a state made without the export"),
|
||||
(false, Err(Error::Translation(metal2vulkan::error::Error::Unsupported(u)))) => {
|
||||
assert_eq!(u.feature, Feature::StencilExport, "{name}: {u:?}");
|
||||
println!("{name}: no stencil export listed; refused naming StencilExport");
|
||||
return;
|
||||
}
|
||||
(false, Err(error)) => panic!("{name}: {error}"),
|
||||
};
|
||||
let mut buffers = Buffers::new(&device);
|
||||
let (positions, colors) = vertices(&device, &mut buffers);
|
||||
let words: Vec<u8> = (0..SIDE * SIDE)
|
||||
.flat_map(|i| value(i).to_le_bytes())
|
||||
.collect();
|
||||
let values = buffers.of(&device, &words);
|
||||
let color = target(
|
||||
&device,
|
||||
PixelFormat::RGBA8Unorm,
|
||||
TextureUsage::RENDER_TARGET,
|
||||
);
|
||||
let stencil = target(&device, PixelFormat::Stencil8, TextureUsage::RENDER_TARGET);
|
||||
let mut replace = DepthStencilDescriptor::default();
|
||||
for face in [
|
||||
&mut replace.front_face_stencil,
|
||||
&mut replace.back_face_stencil,
|
||||
] {
|
||||
face.depth_stencil_pass_operation = StencilOperation::Replace;
|
||||
}
|
||||
let replace = device.new_depth_stencil_state(&replace);
|
||||
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(&pass(&color, Some(&stencil))))
|
||||
.unwrap_or_else(|error| panic!("{name}: {error}"));
|
||||
let draw = |result: Result<(), Error>| result.unwrap_or_else(|e| panic!("{name}: {e}"));
|
||||
draw(encoder.set_render_pipeline_state(&state));
|
||||
draw(encoder.set_vertex_buffer(Some(&positions), 0, 0));
|
||||
draw(encoder.set_vertex_buffer(Some(&colors), 0, 1));
|
||||
draw(encoder.set_fragment_buffer(Some(&values), 0, 0));
|
||||
draw(encoder.set_fragment_bytes(&SIDE.to_le_bytes(), 1));
|
||||
// The encoder's reference, which the fragment's output replaces.
|
||||
encoder.set_stencil_reference_value(0x5a);
|
||||
draw(encoder.set_depth_stencil_state(Some(&replace)));
|
||||
// The second triangle covers the whole target.
|
||||
draw(encoder.draw_primitives(PrimitiveType::Triangle, 3, 3, 1, 0));
|
||||
encoder.end_encoding();
|
||||
run(name, &command_buffer);
|
||||
if stencil.unit().is_some() {
|
||||
let want: Vec<u8> = (0..SIDE * SIDE).map(|i| value(i) as u8).collect();
|
||||
assert_eq!(read(&stencil, 1), want, "{name}: the stencil");
|
||||
}
|
||||
println!(
|
||||
"{name}: VK_EXT_shader_stencil_export enabled; {} pixels stored their fragment's \
|
||||
stencil output",
|
||||
SIDE * SIDE
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -568,7 +568,7 @@ const-value metal2vulkan-runtime::floor::BORDER_SWIZZLE_EXTENSIONS &[ash::ext::c
|
||||
const-value metal2vulkan-runtime::floor::BUFFER_USAGE vk::BufferUsageFlags::from_raw(vk::BufferUsageFlags::TRANSFER_SRC.as_raw() | vk::BufferUsageFlags::TRANSFER_DST.as_raw() | vk::BufferUsageFlags::UNIFORM_TEXEL_BUFFER.as_raw() | vk::BufferUsageFlags::STORAGE_TEXEL_BUFFER.as_raw() | vk::BufferUsageFlags::UNIFORM_BUFFER.as_raw() | vk::BufferUsageFlags::STORAGE_BUFFER.as_raw() | vk::BufferUsageFlags::INDEX_BUFFER.as_raw() | vk::BufferUsageFlags::VERTEX_BUFFER.as_raw() | vk::BufferUsageFlags::INDIRECT_BUFFER.as_raw() | vk::BufferUsageFlags::SHADER_DEVICE_ADDRESS.as_raw())
|
||||
const-value metal2vulkan-runtime::floor::DEVICE_EXTENSIONS &[ash::khr::swapchain::NAME, ash::ext::robustness2::NAME, ash::ext::calibrated_timestamps::NAME, ash::ext::line_rasterization::NAME]
|
||||
const-value metal2vulkan-runtime::floor::INSTANCE_EXTENSIONS &[ash::khr::surface::NAME]
|
||||
const-value metal2vulkan-runtime::floor::OPTIONAL_EXTENSIONS &[ash::khr::shader_maximal_reconvergence::NAME, ash::khr::shader_subgroup_uniform_control_flow::NAME, ash::khr::shader_quad_control::NAME, ash::ext::fragment_shader_interlock::NAME, ash::khr::portability_subset::NAME, ash::khr::vertex_attribute_divisor::NAME, ash::ext::vertex_attribute_divisor::NAME, ash::ext::external_memory_host::NAME, ash::khr::external_memory_fd::NAME, ash::ext::external_memory_dma_buf::NAME, ash::khr::external_memory_win32::NAME, ash::ext::queue_family_foreign::NAME, ash::ext::image_drm_format_modifier::NAME, ash::nv::linear_color_attachment::NAME]
|
||||
const-value metal2vulkan-runtime::floor::OPTIONAL_EXTENSIONS &[ash::khr::shader_maximal_reconvergence::NAME, ash::khr::shader_subgroup_uniform_control_flow::NAME, ash::khr::shader_quad_control::NAME, ash::ext::fragment_shader_interlock::NAME, ash::ext::shader_stencil_export::NAME, ash::khr::portability_subset::NAME, ash::khr::vertex_attribute_divisor::NAME, ash::ext::vertex_attribute_divisor::NAME, ash::ext::external_memory_host::NAME, ash::khr::external_memory_fd::NAME, ash::ext::external_memory_dma_buf::NAME, ash::khr::external_memory_win32::NAME, ash::ext::queue_family_foreign::NAME, ash::ext::image_drm_format_modifier::NAME, ash::nv::linear_color_attachment::NAME]
|
||||
const-value metal2vulkan-runtime::floor::OPTIONAL_INSTANCE_EXTENSIONS &[ash::khr::portability_enumeration::NAME]
|
||||
const-value metal2vulkan-runtime::floor::TIME_DOMAINS [vk::TimeDomainKHR::DEVICE, crate::times::HOST_DOMAIN]
|
||||
const-value metal2vulkan-runtime::floor::VERSION vk::API_VERSION_1_3
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -42,7 +42,7 @@ Its limits, measured rather than asserted:
|
||||
| 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) | 7687 |
|
||||
| ledger rows (a case whose gap is recorded) | 7692 |
|
||||
| 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 |
|
||||
|
||||
@@ -3335,6 +3335,11 @@ A case whose difference from Metal is recorded rather than compared away. The le
|
||||
| `pass-bytes-srgb-encode-sweep` | The device's own answer (rule 1): the device's sRGB encode lands one code from Metal's (Metal 0x20201, ours 0x20101 at the first differing element). Note `devic… |
|
||||
| `pass-bytes-srgb-encode-sweep` | The device's own answer (rule 1): the device's sRGB encode lands one code from Metal's (Metal 0x20201, ours 0x20101 at the first differing element). Note `devic… |
|
||||
| `pass-sequence-aspect-actions` | 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).… |
|
||||
| `pass-sequence-aspect-actions` | 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).… |
|
||||
| `pass-sequence-aspect-actions` | 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).… |
|
||||
| `pass-sequence-aspect-actions` | 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).… |
|
||||
| `pass-sequence-aspect-actions` | 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).… |
|
||||
| `pass-sequence-aspect-actions` | 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).… |
|
||||
| `pass-start-barrier-new-texture-chain` | rt's own gap, not the device's: the pass reads, at its own pixels, its target, a texture over a buffer, and where the device's linear image lies at the buffer's… |
|
||||
| `pipeline-options-compute-binding-info-and-undefined-bit` | refused: the consumer's own (MTLComputePipelineReflection, MTLRenderPipelineReflection, MTLPipelineOptionFailOnBinaryArchiveMiss, MTLPipelineOptionArgumentInfo,… |
|
||||
| `pipeline-options-compute-undefined-bit-3` | refused: the consumer's own (MTLComputePipelineReflection, MTLRenderPipelineReflection, MTLPipelineOptionFailOnBinaryArchiveMiss, MTLPipelineOptionArgumentInfo,… |
|
||||
|
||||
Reference in new issue
Block a user