rt: the floor requires the eight features every floor driver reports that the translator's shaders and states use

The feature-class table: every VkFeature the translator names that every floor driver's dump
reports (vulkaninfo, m3-max-50586 to 50592: RADV on the RX 7900 XTX, the 780M and the RX 550;
NVIDIA on the RTX 2080, both RTX 3090s and the RTX 5080 Laptop; ANV on the Iris Xe; Intel's
Windows driver on the UHD 630; KosmicKrisp on the M3 Max; lavapipe) and that floor.rs neither
required nor enabled. Device creation enabled none of them, and the translator's description takes
enabled features alone, so on every device its profile read each as absent.

Joining REQUIRED:
- shaderStorageImageExtendedFormats: a read-write texture of a storage-extended format declared
  with its format where a shader reads it (Vulkan 1.4, Roadmap 2022);
- samplerMirrorClampToEdge: MTLSamplerAddressModeMirrorClampToEdge, refused before (Vulkan 1.4,
  Roadmap 2022);
- shaderImageGatherExtended: a gather at a computed offset (Vulkan 1.4);
- alphaToOne: alphaToOneEnabled, refused before as RenderPipelineKind::AlphaToOne, which goes; the
  pipeline now takes alphaToOneEnable;
- logicOp: the private logic operation, the device's own; the pipeline now takes logicOpEnable and
  the translator's operation (without the feature the fragment function computes it, which needs
  interlock or raster-order access, neither in the floor);
- fullDrawIndexUint32: 32-bit indices past 2^24 - 1 (Vulkan 1.4, Roadmap 2022);
- shaderClipDistance: [[clip_distance]];
- shaderTessellationAndGeometryPointSize: a post-tessellation vertex function's [[point_size]],
  dropped to size 1 before.

The README's floor table names each; the floor test's synthetic device has each, and its
below-floor cases name each (50).
This commit is contained in:
Anees Iqbal committed 2026-11-19 02:40:40 -08:00
1 parent 6ab6e882fb
commit 6529ce3187
6 files changed
+89 -9

No files matched your search

+9 -1
View File
@@ -1858,7 +1858,7 @@ 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, framebuffer fetch, an imageblock, a
fragment function's stencil output, alpha to one, constant data the binder supplies, a
fragment function's stencil output, constant data the binder supplies, 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
@@ -2303,6 +2303,9 @@ Presenting runs on the runtime's own device; nothing is exported or imported.
| `shaderStorageImageWriteWithoutFormat` | `VkPhysicalDeviceFeatures` | writes to array elements of any pixel format |
| `nullDescriptor` | `VkPhysicalDeviceRobustness2FeaturesEXT` | every texture element no texture owns: a nil, freed or unowned index reads zeros, sizes 0 and drops writes, as Metal's nil texture does. The robust buffer access beside it stays off |
| `samplerAnisotropy` | `VkPhysicalDeviceFeatures` | a sampler state's `maxAnisotropy`, which the device's own filter takes |
| `shaderStorageImageExtendedFormats` | `VkPhysicalDeviceFeatures` | a read-write texture of a format Vulkan lists among the storage image extended formats (`RG16Float`, `RG11B10Float`, `R8Unorm` and the rest), declared with its format where a shader reads it; Vulkan 1.4 and Roadmap 2022 require it |
| `samplerMirrorClampToEdge` | `VkPhysicalDeviceVulkan12Features` | a sampler state's `MTLSamplerAddressModeMirrorClampToEdge`; Vulkan 1.4 and Roadmap 2022 require it |
| `shaderImageGatherExtended` | `VkPhysicalDeviceFeatures` | a gather at an offset the shader computes; Vulkan 1.4 requires it |
| `shaderInt16` | `VkPhysicalDeviceFeatures` | `short` and `ushort` in shaders |
| `shaderInt8` | `VkPhysicalDeviceVulkan12Features` | `char` and `uchar` in shaders |
| `storageBuffer16BitAccess` | `VkPhysicalDeviceVulkan11Features` | 16-bit values in buffers |
@@ -2317,7 +2320,12 @@ Presenting runs on the runtime's own device; nothing is exported or imported.
| `robustImageAccess2` | `VkPhysicalDeviceRobustness2FeaturesEXT` | an image read or fetch out of range, past the view's levels included, answering Metal's texel (zero, alpha 1 for a format without alpha), with no check in the shader; a texel buffer's read is still checked in the shader |
| `independentBlend` | `VkPhysicalDeviceFeatures` | each color attachment of a render pipeline blended by its own state, as Metal's are |
| `fragmentStoresAndAtomics` | `VkPhysicalDeviceFeatures` | a fragment function's writes and atomics on device memory |
| `alphaToOne` | `VkPhysicalDeviceFeatures` | a render pipeline's `alphaToOneEnabled` |
| `logicOp` | `VkPhysicalDeviceFeatures` | a render pipeline's logic operation (private render state), the device's own; without it the fragment function would compute it, which needs fragment interlock or raster-order attachment access |
| `fullDrawIndexUint32` | `VkPhysicalDeviceFeatures` | an indexed draw's 32-bit indices past `2^24 - 1`; Vulkan 1.4 and Roadmap 2022 require it |
| `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 |
| `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 |
| `vertexPipelineStoresAndAtomics` | `VkPhysicalDeviceFeatures` | a vertex or post-tessellation vertex function's writes and atomics on device memory |
-2
View File
@@ -1164,8 +1164,6 @@ pub enum RenderPipelineKind {
Imageblock,
/// A fragment function's stencil output applied by the shader.
ShaderStencil,
/// `alphaToOneEnabled`, which needs a feature the floor does not require.
AlphaToOne,
/// A function that reads constant data the binder supplies.
ConstantData,
/// A specialization the draw would set, beside the sample and amplification counts.
+28
View File
@@ -292,8 +292,18 @@ pub(crate) const REQUIRED: &[Feature] = &[
feature!(vulkan12.shader_sampled_image_array_non_uniform_indexing => ShaderSampledImageArrayNonUniformIndexing),
feature!(vulkan12.shader_storage_image_array_non_uniform_indexing => ShaderStorageImageArrayNonUniformIndexing),
feature!(core.shader_storage_image_write_without_format => ShaderStorageImageWriteWithoutFormat),
// A read-write texture of a format Vulkan lists among the storage image extended formats
// (`RG16Float`, `RG11B10Float`, `R8Unorm` and the rest), declared with its format where a
// shader reads it. Vulkan 1.4 and Roadmap 2022 require it of every device.
feature!(core.shader_storage_image_extended_formats => ShaderStorageImageExtendedFormats),
// A sampler state's anisotropy is the device's own filter.
feature!(core.sampler_anisotropy => SamplerAnisotropy),
// A sampler state's `MTLSamplerAddressModeMirrorClampToEdge`, the device's own address mode.
// Vulkan 1.4 and Roadmap 2022 require it of every device.
feature!(vulkan12.sampler_mirror_clamp_to_edge => SamplerMirrorClampToEdge),
// A gather at an offset the shader computes, as Metal's `gather` takes one. Vulkan 1.4
// requires it of every device.
feature!(core.shader_image_gather_extended => ShaderImageGatherExtended),
// Every array element no texture owns is a null descriptor: a nil, freed or unowned texture
// index reads zeros, answers 0 to its size queries and drops its writes, as Metal's nil
// texture does, with no code in the shader.
@@ -326,10 +336,28 @@ pub(crate) const REQUIRED: &[Feature] = &[
// requires both of every graphics device.
feature!(core.independent_blend => IndependentBlend),
feature!(core.fragment_stores_and_atomics => FragmentStoresAndAtomics),
// A render pipeline's `alphaToOneEnabled`, the device's own: each sample's alpha 1 after the
// coverage is taken. Every floor driver reports it.
feature!(core.alpha_to_one => AlphaToOne),
// A render pipeline's logic operation (private render state), the device's own `logicOp`. A
// device without it would compute the operation in the fragment function, which needs
// fragment interlock or raster-order attachment access, neither in the floor. Every floor
// driver reports it.
feature!(core.logic_op => LogicOp),
// An indexed draw's 32-bit indices past `2^24 - 1`, which Metal draws. Vulkan 1.4 and
// Roadmap 2022 require it of every device.
feature!(core.full_draw_index_uint32 => FullDrawIndexUint32),
// A vertex or post-tessellation vertex function's `[[clip_distance]]`, the device's own
// clipping. Every floor driver reports it.
feature!(core.shader_clip_distance => ShaderClipDistance),
// A render pipeline of a post-tessellation vertex function draws its patches through the
// device's tessellator: a synthesized control stage reads each patch's factors through their
// address, and the function is the evaluation stage. A device without it is below the floor.
feature!(core.tessellation_shader => TessellationShader),
// A post-tessellation vertex function's `[[point_size]]`, which a point draw of its patches
// 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 fragment function's second output for a colour attachment (`[[color(0), index(1)]]`)
// blends with its first, as Metal's dual-source blending does. A device without it is below
// the floor.
+14 -4
View File
@@ -200,7 +200,13 @@ struct Fixed {
discard: bool,
samples: vk::SampleCountFlags,
alpha_to_coverage: bool,
/// `alphaToOneEnabled`, the device's own (`alphaToOne`, which the floor requires).
alpha_to_one: bool,
blends: Vec<vk::PipelineColorBlendAttachmentState>,
/// The logic operation the translator states (private render state), the device's own
/// (`logicOp`, which the floor requires); `None` with the operation off, or copy or no-op,
/// which the attachments' states already draw.
logic_op: Option<vk::LogicOp>,
/// Each colour attachment's format by Metal index, `UNDEFINED` for an absent one.
colors: Vec<vk::Format>,
/// A patch list's control points per patch (`patchControlPoints`), 0 but for a
@@ -556,8 +562,6 @@ fn unbuilt(pipeline: &RenderPipeline, enabled: &EnabledCaps) -> Option<RenderPip
RenderPipelineKind::Imageblock
} else if g.shadow_stencil.is_some() {
RenderPipelineKind::ShaderStencil
} else if g.alpha_to_one {
RenderPipelineKind::AlphaToOne
} else if (pipeline.stages.iter()).any(|stage| stage.constant_blob.is_some()) {
RenderPipelineKind::ConstantData
} else if !(g.dynamic_states.iter()).all(|state| DYNAMIC.contains(&dynamic(*state))) {
@@ -646,7 +650,9 @@ impl Fixed {
discard: g.rasterizer_discard,
samples: vk::SampleCountFlags::from_raw(g.rasterization_samples.as_raw()),
alpha_to_coverage: g.alpha_to_coverage,
alpha_to_one: g.alpha_to_one,
blends,
logic_op: (g.logic_op).map(|op| vk::LogicOp::from_raw(op.as_raw())),
colors,
depth: format(g.depth_format),
stencil: format(g.stencil_format),
@@ -872,9 +878,13 @@ impl RenderCompiled {
.line_width(1.0);
let multisample = vk::PipelineMultisampleStateCreateInfo::default()
.rasterization_samples(fixed.samples)
.alpha_to_coverage_enable(fixed.alpha_to_coverage);
.alpha_to_coverage_enable(fixed.alpha_to_coverage)
.alpha_to_one_enable(fixed.alpha_to_one);
let depth_stencil = vk::PipelineDepthStencilStateCreateInfo::default();
let blend = vk::PipelineColorBlendStateCreateInfo::default().attachments(&fixed.blends);
let mut blend = vk::PipelineColorBlendStateCreateInfo::default().attachments(&fixed.blends);
if let Some(op) = fixed.logic_op {
blend = blend.logic_op_enable(true).logic_op(op);
}
// Where the device reads attachments through textures, every pipeline takes the feedback
// loop's enable as dynamic state too: a state is made before any draw binds its textures.
let feedback = core.feedback.is_some();
+38 -1
View File
@@ -56,6 +56,14 @@ fn at_the_floor() -> Queried {
.shader_storage_image_array_non_uniform_indexing = vk::TRUE;
features.core.shader_storage_image_write_without_format = vk::TRUE;
features.core.sampler_anisotropy = vk::TRUE;
features.core.shader_storage_image_extended_formats = vk::TRUE;
features.vulkan12.sampler_mirror_clamp_to_edge = vk::TRUE;
features.core.shader_image_gather_extended = vk::TRUE;
features.core.alpha_to_one = vk::TRUE;
features.core.logic_op = vk::TRUE;
features.core.full_draw_index_uint32 = vk::TRUE;
features.core.shader_clip_distance = vk::TRUE;
features.core.shader_tessellation_and_geometry_point_size = vk::TRUE;
features.core.shader_int16 = vk::TRUE;
features.vulkan12.shader_int8 = vk::TRUE;
features.vulkan11.storage_buffer16_bit_access = vk::TRUE;
@@ -336,7 +344,7 @@ fn each_missing_feature_is_named() {
const CORE: &str = "VkPhysicalDeviceFeatures";
const ROBUSTNESS2: &str = "VkPhysicalDeviceRobustness2FeaturesEXT";
type Clear = fn(&mut Features);
let cases: [(Clear, Missing); 42] = [
let cases: [(Clear, Missing); 50] = [
(
|f| f.vulkan12.buffer_device_address = vk::FALSE,
feature(V12, "bufferDeviceAddress"),
@@ -511,6 +519,35 @@ fn each_missing_feature_is_named() {
|f| f.core.sampler_anisotropy = vk::FALSE,
feature(CORE, "samplerAnisotropy"),
),
(
|f| f.core.shader_storage_image_extended_formats = vk::FALSE,
feature(CORE, "shaderStorageImageExtendedFormats"),
),
(
|f| f.vulkan12.sampler_mirror_clamp_to_edge = vk::FALSE,
feature(V12, "samplerMirrorClampToEdge"),
),
(
|f| f.core.shader_image_gather_extended = vk::FALSE,
feature(CORE, "shaderImageGatherExtended"),
),
(
|f| f.core.alpha_to_one = vk::FALSE,
feature(CORE, "alphaToOne"),
),
(|f| f.core.logic_op = vk::FALSE, feature(CORE, "logicOp")),
(
|f| f.core.full_draw_index_uint32 = vk::FALSE,
feature(CORE, "fullDrawIndexUint32"),
),
(
|f| f.core.shader_clip_distance = vk::FALSE,
feature(CORE, "shaderClipDistance"),
),
(
|f| f.core.shader_tessellation_and_geometry_point_size = vk::FALSE,
feature(CORE, "shaderTessellationAndGeometryPointSize"),
),
];
assert_eq!(
cases.len(),
@@ -13973,7 +13973,6 @@ variant metal2vulkan-rt::RenderPassKind::Resolve Resolve
variant metal2vulkan-rt::RenderPassKind::SampleCounts SampleCounts
variant metal2vulkan-rt::RenderPassKind::StoreAction StoreAction
variant metal2vulkan-rt::RenderPassKind::TextureType TextureType
variant metal2vulkan-rt::RenderPipelineKind::AlphaToOne AlphaToOne
variant metal2vulkan-rt::RenderPipelineKind::ConstantData ConstantData
variant metal2vulkan-rt::RenderPipelineKind::DepthStencilFormats DepthStencilFormats
variant metal2vulkan-rt::RenderPipelineKind::DeviceFeature DeviceFeature
Can't render this file because it is too large.