diff --git a/AGENTS.md b/AGENTS.md index 68cd13019..24823c27d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -122,10 +122,12 @@ as a known gap. `FALLBACK`). Never emit wrong-but-valid SPIR-V to silence a gate. - **Scope.** The runtime has a floor: one Vulkan version plus a fixed extension list (`crates/metal2vulkan-runtime/README.md`); a device below it gets a typed refusal. Above the floor, - refuse only what the device truly lacks, and implement the rest. A Metal feature that no guest - has used, in a replay stream or a live session, is a typed refusal until one does; a refusal a - guest meets is a bug, ranked by how often guests meet it. A near-equivalent, the device's native - answer included, is allowed only when the operation carries its static note (rule 1). + refuse only what the device truly lacks, and implement the rest. A Metal feature a program can + ask the device about is answered from the Vulkan query and refused where the device lacks it. A + feature Metal gives every Mac device with no way to ask is built; until it is built it is a typed + refusal recorded in the runtime's known gaps. A refusal a guest meets is a bug, ranked by how + often guests meet it. A near-equivalent, the device's native answer included, is allowed only + when the operation carries its static note (rule 1). - **Unknown stays unknown.** Do not invent semantics for unsupported opcodes, types or layouts. Fail visibly and leave a test or a doc note. - **No env-gated product paths.** Translation never branches on environment variables. The diff --git a/crates/metal2vulkan-conformance/known-gaps-rt.tsv b/crates/metal2vulkan-conformance/known-gaps-rt.tsv index fa94d01d2..06563b93f 100644 --- a/crates/metal2vulkan-conformance/known-gaps-rt.tsv +++ b/crates/metal2vulkan-conformance/known-gaps-rt.tsv @@ -6086,7 +6086,6 @@ read-write-tier-round-trip-float Iris(R) Xe refused case/MTLPixelFormatRGBA8Unor render-draw-forms-empty * refused case/pieces/pass Err(Unavailable({call: "render step DrawIndirect"})) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no indirect draw). The rt side of the suite answers `render step DrawIndirect` Unavailable: rt has no counterpart of the call, and no replay stream makes it. render-draw-forms-points * refused case/pieces/pass Err(Unavailable({call: "render step DrawIndirect"})) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no indirect draw). The rt side of the suite answers `render step DrawIndirect` Unavailable: rt has no counterpart of the call, and no replay stream makes it. render-draw-forms-triangles * refused case/pieces/pass Err(Unavailable({call: "render step DrawIndirect"})) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no indirect draw). The rt side of the suite answers `render step DrawIndirect` Unavailable: rt has no counterpart of the call, and no replay stream makes it. -render-state-depth-bias * refused case/pieces/pass Err(Error::Unsupported("a draw with DepthBiasClamp is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, every setDepthBias:slopeScale:clamp: clamp 0). rt refuses it (a draw with DepthBiasClamp is not built), and no replay stream asks it. render-state-depth-clip * refused case/pieces/pass Err(Error::Unsupported("a draw with DepthClamp is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, every depth clip mode Clip). rt refuses it (a draw with DepthClamp is not built), and no replay stream asks it. render-state-facing * refused case/pieces/pass Err(Error::Unsupported("a draw with FillMode is not built")) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, every setTriangleFillMode: Fill). rt refuses it (a draw with FillMode is not built), and no replay stream asks it. render-state-heap-residency * refused case/heap Err(Unavailable({call: "sparse_heap"})) refused: no stream uses it yet (full selector census 11-19, m3-max-53207-53208, 53213, 53217-53221: 26 streams, no sparse texture, heap or tile call). The rt side of the suite answers `sparse_heap` Unavailable: rt has no counterpart of the call, and no replay stream makes it. diff --git a/crates/metal2vulkan-conformance/src/rt_side/render.rs b/crates/metal2vulkan-conformance/src/rt_side/render.rs index 2faa4313f..be1116b8a 100644 --- a/crates/metal2vulkan-conformance/src/rt_side/render.rs +++ b/crates/metal2vulkan-conformance/src/rt_side/render.rs @@ -462,7 +462,8 @@ impl RtSide<'_> { Ok(()) } RenderStep::DepthBias(v) => { - (encoder.set_depth_bias(v.bias, v.slope_scale, v.clamp)).map_err(of_rt) + encoder.set_depth_bias(v.bias, v.slope_scale, v.clamp); + Ok(()) } RenderStep::FillMode(mode) => encoder.set_triangle_fill_mode(*mode).map_err(of_rt), RenderStep::VisibilityResultMode { mode, offset } => { diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index 652e14e46..6bc6a7e76 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -3004,9 +3004,11 @@ or does not check is rebuilt from the generations' names, with young counted ful one a GPU write gives as a zero. A negative or NaN depth, which Metal's test compares by its magnitude, takes none: no clear, viewport or upload gives one, and Vulkan leaves a depth past the viewport's range undefined. In a pass without a depth attachment Vulkan skips the depth - test, where Metal's documentation states no answer. `set_depth_bias` takes the bias and slope - scale as given; a draw of triangles is biased where either is not zero and a draw of lines - never, as Metal biases triangles alone, under the static note `PrecisionNote::DeviceDepthBias` + test, where Metal's documentation states no answer. `set_depth_bias` takes the bias, slope + scale and clamp as given; a draw of triangles is biased where the bias or the slope scale is not + zero and a draw of lines never, as Metal biases triangles alone, and the clamp bounds the bias as + Metal's does (a positive clamp from above, a negative one from below, 0 not at all), under the + static note `PrecisionNote::DeviceDepthBias` (`RenderCommandEncoder::DEPTH_BIAS_NOTE`): the slope measure, and a fixed-point attachment's unit, are the device's; Apple states neither. Where a pass has both a depth and a stencil attachment they are one texture's same level and slice, a @@ -3171,8 +3173,7 @@ or does not check is rebuilt from the generations' names, with young counted ful ### Known gaps of render encoders -- Refused by `Gap::Draw`, naming its `DrawKind`: a depth bias clamp other - than 0 (`DepthBiasClamp`, set by `set_depth_bias`), a triangle fill mode but `Fill` +- Refused by `Gap::Draw`, naming its `DrawKind`: a triangle fill mode but `Fill` (`FillMode`, `set_triangle_fill_mode`), the depth clip mode `Clamp` (`DepthClamp`, `set_depth_clip_mode`), a count of viewports or scissor rectangles other than 1 (`Viewports`, `set_viewports`, `set_scissor_rects`), a visibility result mode but `Disabled` @@ -3196,8 +3197,7 @@ or does not check is rebuilt from the generations' names, with young counted ful VUID-vkCmdDraw-pNext-09461); the same draw from base instance 0 runs. An indirect draw, whose base instance the CPU does not see, is not built. A patch draw through a patch index buffer is `PatchIndexBuffer`: the control stage takes each patch's index from its position, and no replay - stream's patch draw names one. The replay streams draw lines and triangles - under depth biases with no clamp; every attachment they read through a texture is + stream's patch draw names one. Every attachment the replay streams read through a texture is a colour render target of `Private` storage, read from the fragment function; and their stepped draws (a WebGL stream's, at rates 2 and 3) are all at base instance 0. A draw that reads its own target over a buffer in place, a linear image on the buffer's memory @@ -3550,6 +3550,7 @@ Presenting runs on the runtime's own device; nothing is exported or imported. | `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 | | `bresenhamLines` | `VkPhysicalDeviceLineRasterizationFeaturesEXT` | a line drawn by Metal's rule, the pixels whose diamond it exits (`VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT`), where Vulkan's default rule is the device's own: the rectangle of the line's width on a device whose `strictLines` is set (lavapipe, NVIDIA's driver); Vulkan 1.4 requires it | | `fullDrawIndexUint32` | `VkPhysicalDeviceFeatures` | an indexed draw's 32-bit indices past `2^24 - 1`; Vulkan 1.4 and Roadmap 2022 require it | +| `depthBiasClamp` | `VkPhysicalDeviceFeatures` | a depth bias's clamp (`set_depth_bias`), the device's own; 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 | diff --git a/crates/metal2vulkan-runtime/src/error.rs b/crates/metal2vulkan-runtime/src/error.rs index 8652d7df7..1dc42fa7e 100644 --- a/crates/metal2vulkan-runtime/src/error.rs +++ b/crates/metal2vulkan-runtime/src/error.rs @@ -1255,8 +1255,8 @@ pub enum Gap { /// ([`RenderCommandEncoder`](crate::RenderCommandEncoder)): what `kind` names. /// /// Basis: 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 + /// with pipeline states of their pass's formats, 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`). Draw { @@ -1432,9 +1432,6 @@ pub enum KernelInputKind { #[non_exhaustive] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum DrawKind { - /// A depth bias clamp other than 0 (`setDepthBias:slopeScale:clamp:`'s `clamp`), which no - /// replay stream sets. - DepthBiasClamp, /// A triangle fill mode but `Fill` (`setTriangleFillMode:`), which no replay stream sets. FillMode, /// The depth clip mode `Clamp` (`setDepthClipMode:`), which no replay stream sets. diff --git a/crates/metal2vulkan-runtime/src/floor.rs b/crates/metal2vulkan-runtime/src/floor.rs index 96f0bc04b..3691f828f 100644 --- a/crates/metal2vulkan-runtime/src/floor.rs +++ b/crates/metal2vulkan-runtime/src/floor.rs @@ -432,6 +432,9 @@ pub(crate) const REQUIRED: &[Feature] = &[ // 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 depth bias's clamp (`setDepthBias:slopeScale:clamp:`), the device's own, set as dynamic + // state. Vulkan 1.4 and Roadmap 2022 require it of every device. + feature!(core.depth_bias_clamp), // 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), diff --git a/crates/metal2vulkan-runtime/src/render_encoder.rs b/crates/metal2vulkan-runtime/src/render_encoder.rs index 4fa448b15..70c80b835 100644 --- a/crates/metal2vulkan-runtime/src/render_encoder.rs +++ b/crates/metal2vulkan-runtime/src/render_encoder.rs @@ -538,8 +538,9 @@ pub struct RenderCommandEncoder { alpha_test: u32, /// The line width `set_line_width` set last, Metal's 1 until set. line_width: f32, - /// The depth bias's constant and slope scale, Metal's `depthBias` and `slopeScale`. - depth_bias: [f32; 2], + /// The depth bias's constant, slope scale and clamp, Metal's `depthBias`, `slopeScale` and + /// `clamp`. + depth_bias: [f32; 3], /// Whether the last draw recorded the depth bias enabled. biased: bool, /// Whether the last draw recorded an empty scissor, for points it does not rasterize @@ -628,7 +629,7 @@ impl CommandBuffer { blend_color: [0.0; 4], alpha_test: alpha_test_code(1.0), line_width: 1.0, - depth_bias: [0.0; 2], + depth_bias: [0.0; 3], biased: false, hidden: false, recorded: None, @@ -1203,33 +1204,21 @@ impl RenderCommandEncoder { /// ([`set_depth_bias`](Self::set_depth_bias)). pub const DEPTH_BIAS_NOTE: PrecisionNote = PrecisionNote::DeviceDepthBias; - /// `setDepthBias:slopeScale:clamp:`: the constant bias and the slope scale, as given. A draw of - /// triangles is biased where either is not zero, and a draw of lines never, as Metal biases - /// triangles alone. Metal's default is no bias. The slope measure, and a fixed-point - /// attachment's unit, are the device's; Apple states neither + /// `setDepthBias:slopeScale:clamp:`: the constant bias, the slope scale and the clamp, as + /// given. A draw of triangles is biased where the bias or the slope scale is not zero, and a + /// draw of lines never, as Metal biases triangles alone. Metal's default is no bias. A positive + /// clamp bounds the bias from above and a negative one from below, and a clamp of 0 bounds + /// nothing, as Metal's and Vulkan's `depthBiasClamp` alike. The slope measure, and a + /// fixed-point attachment's unit, are the device's; Apple states neither /// ([`DEPTH_BIAS_NOTE`](Self::DEPTH_BIAS_NOTE)). A biased depth past the viewport's depth /// range is undefined in Vulkan. /// /// A bias equal to the one set already records nothing. - /// - /// Err: [`Gap::Draw`] of [`DrawKind::DepthBiasClamp`] for a clamp other than 0; the encoder's - /// bias is unchanged. - pub fn set_depth_bias( - &mut self, - depth_bias: f32, - slope_scale: f32, - clamp: f32, - ) -> Result<(), Error> { - if clamp != 0.0 { - return Err(Error::Unsupported(Gap::Draw { - kind: DrawKind::DepthBiasClamp, - })); - } - if [depth_bias, slope_scale] != self.depth_bias { - self.depth_bias = [depth_bias, slope_scale]; + pub fn set_depth_bias(&mut self, depth_bias: f32, slope_scale: f32, clamp: f32) { + if [depth_bias, slope_scale, clamp] != self.depth_bias { + self.depth_bias = [depth_bias, slope_scale, clamp]; self.dirty |= BIAS; } - Ok(()) } /// `setTriangleFillMode:`: `Fill`, Metal's default, is every draw's; another mode is not @@ -2411,7 +2400,7 @@ impl RenderCommandEncoder { device.cmd_set_blend_constants(command, &self.blend_color); } // Metal biases triangles alone, where the bias or the slope scale is not zero. - let [constant, slope] = self.depth_bias; + let [constant, slope, clamp] = self.depth_bias; let triangles = !matches!( topology, vk::PrimitiveTopology::LINE_LIST @@ -2420,7 +2409,7 @@ impl RenderCommandEncoder { ); let biased = triangles && (constant != 0.0 || slope != 0.0); if dirty & BIAS != 0 { - device.cmd_set_depth_bias(command, constant, 0.0, slope); + device.cmd_set_depth_bias(command, constant, clamp, slope); } if dirty & BIAS != 0 || biased != self.biased { device.cmd_set_depth_bias_enable(command, biased); diff --git a/crates/metal2vulkan-runtime/src/tests/draw.rs b/crates/metal2vulkan-runtime/src/tests/draw.rs index 5b04c0df5..177b7c57a 100644 --- a/crates/metal2vulkan-runtime/src/tests/draw.rs +++ b/crates/metal2vulkan-runtime/src/tests/draw.rs @@ -1286,10 +1286,11 @@ pub(crate) mod on_device { /// pipeline is made by a change of depth-stencil state or bias, and the pass is one /// submission, the barriers of a shader-read depth texture's pass, and one pass. Cleared to /// 0.5 with its store action left unknown and set by the encoder: a draw at depth 0.25 under - /// `Less` with writes passes and writes 0.25; one at 0.375 then fails; one at 0.25 under - /// `Greater`, without writes, passes only by its bias (a constant of 2^23, which Vulkan's unit - /// for a `float` depth of exponent -2 makes 0.25, or 0.125 where the device counts 24 mantissa - /// bits). The setters that take Metal's defaults as nothing refuse every other value. + /// `Less` with writes, biased by a constant of 2^23 (which Vulkan's unit for a `float` depth of + /// exponent -2 makes 0.25, or 0.125 where the device counts 24 mantissa bits) clamped to + /// 0.0625, passes and writes 0.3125 on every device; one at 0.375 with no bias then fails; one + /// at 0.25 under `Greater`, without writes, passes only by its unclamped bias of 2^23. The + /// setters that take Metal's defaults as nothing refuse every other value. #[test] fn every_device_tests_writes_and_biases_a_depth_attachment() { let Some(library) = examples() else { @@ -1359,23 +1360,21 @@ pub(crate) mod on_device { draw(encoder.set_render_pipeline_state(&depth_state)); draw(encoder.set_vertex_buffer(Some(&positions), 0, 0)); draw(encoder.set_vertex_buffer(Some(&colors), 0, 1)); - // Blue at 0.25 passes `Less` against 0.5 and writes 0.25. + // Blue at 0.25, biased by 0.25 or 0.125 clamped to 0.0625, passes `Less` against 0.5 + // and writes 0.3125. draw(encoder.set_depth_stencil_state(Some(&less))); draw(encoder.set_viewport(at(0.25))); + encoder.set_depth_bias(8_388_608.0, 0.0, 0.0625); draw(encoder.draw_primitives(PrimitiveType::Triangle, 3, 3, 1, 0)); - // White at 0.375 fails `Less` against 0.25. + // White at 0.375 with no bias fails `Less` against 0.3125. + encoder.set_depth_bias(0.0, 0.0, 0.0); draw(encoder.set_viewport(at(0.375))); draw(encoder.draw_primitives(PrimitiveType::Triangle, 6, 3, 1, 0)); - // White at 0.25 passes `Greater` against 0.25 by its bias alone. + // White at 0.25 passes `Greater` against 0.3125 by its bias alone. draw(encoder.set_depth_stencil_state(Some(&greater))); draw(encoder.set_viewport(at(0.25))); - draw(encoder.set_depth_bias(8_388_608.0, 0.0, 0.0)); + encoder.set_depth_bias(8_388_608.0, 0.0, 0.0); draw(encoder.draw_primitives(PrimitiveType::Triangle, 6, 3, 1, 0)); - same( - encoder.set_depth_bias(1.0, 0.0, 0.5), - gap(DrawKind::DepthBiasClamp), - "a depth bias clamp", - ); draw(encoder.set_triangle_fill_mode(crate::TriangleFillMode::Fill)); same( encoder.set_triangle_fill_mode(crate::TriangleFillMode::Lines), @@ -1419,13 +1418,13 @@ pub(crate) mod on_device { "{name}: submissions, passes, pipelines made, bytes copied" ); println!( - "{name}: {} barriers, {} pipelines made by three depth-stencil states and a bias", + "{name}: {} barriers, {} pipelines made by three depth-stencil states and biases", after.barriers - before.barriers, after.pipelines_created - before.pipelines_created ); assert_eq!(read(&color, 4), texels(|_, _| WHITE), "{name}: the colour"); if depth.unit().is_some() { - let want = floats(&[0.25; (SIDE * SIDE) as usize]); + let want = floats(&[0.3125; (SIDE * SIDE) as usize]); assert_eq!(read(&depth, 4), want, "{name}: the depth written"); } else { println!("{name}: the depth's bytes are not copied on this device"); @@ -1520,12 +1519,12 @@ pub(crate) mod on_device { for at in 0..DRAWS { if setting == again { draw(encoder.set_depth_stencil_state(Some(&states[0]))); - draw(encoder.set_depth_bias(0.0, 0.0, 0.0)); + encoder.set_depth_bias(0.0, 0.0, 0.0); } if setting == change { let state = &states[at as usize % 2]; draw(encoder.set_depth_stencil_state(Some(state))); - draw(encoder.set_depth_bias(at as f32, 0.0, 0.0)); + encoder.set_depth_bias(at as f32, 0.0, 0.0); } if drawn { draw(encoder.draw_primitives(PrimitiveType::Triangle, 3, 3, 1, 0)); diff --git a/crates/metal2vulkan-validation/src/replay/new_runtime/render.rs b/crates/metal2vulkan-validation/src/replay/new_runtime/render.rs index ff5768fd7..c5ef7b3b2 100644 --- a/crates/metal2vulkan-validation/src/replay/new_runtime/render.rs +++ b/crates/metal2vulkan-validation/src/replay/new_runtime/render.rs @@ -916,7 +916,8 @@ impl NewRuntime { None => Err(refuse(call, format!("argument {at} is no float"))), }; let [bias, slope, clamp] = [float(0)?, float(1)?, float(2)?]; - self.render(id).encoder.set_depth_bias(bias, slope, clamp) + self.render(id).encoder.set_depth_bias(bias, slope, clamp); + Ok(()) } "setColorStoreAction:atIndex:" => { let (action, at) = (store_action(call, uint(call, 0)?)?, uint(call, 1)?); diff --git a/crates/metal2vulkan/tests/api_signatures.tsv b/crates/metal2vulkan/tests/api_signatures.tsv index 6e5d37b68..3c1d91018 100644 --- a/crates/metal2vulkan/tests/api_signatures.tsv +++ b/crates/metal2vulkan/tests/api_signatures.tsv @@ -6662,7 +6662,7 @@ method metal2vulkan-runtime::RenderCommandEncoder::set_alpha_test_reference_valu method metal2vulkan-runtime::RenderCommandEncoder::set_blend_color pub fn set_blend_color(&mut self, red: f32, green: f32, blue: f32, alpha: f32) method metal2vulkan-runtime::RenderCommandEncoder::set_color_store_action pub fn set_color_store_action(&mut self, action: StoreAction, index: usize) -> Result<(), Error> method metal2vulkan-runtime::RenderCommandEncoder::set_cull_mode pub fn set_cull_mode(&mut self, mode: CullMode) -method metal2vulkan-runtime::RenderCommandEncoder::set_depth_bias pub fn set_depth_bias(&mut self, depth_bias: f32, slope_scale: f32, clamp: f32) -> Result<(), Error> +method metal2vulkan-runtime::RenderCommandEncoder::set_depth_bias pub fn set_depth_bias(&mut self, depth_bias: f32, slope_scale: f32, clamp: f32) method metal2vulkan-runtime::RenderCommandEncoder::set_depth_clip_mode pub fn set_depth_clip_mode(&mut self, mode: DepthClipMode) -> Result<(), Error> method metal2vulkan-runtime::RenderCommandEncoder::set_depth_stencil_state pub fn set_depth_stencil_state(&mut self, state: Option<&DepthStencilState>) -> Result<(), Error> method metal2vulkan-runtime::RenderCommandEncoder::set_depth_store_action pub fn set_depth_store_action(&mut self, action: StoreAction) -> Result<(), Error> @@ -9185,7 +9185,6 @@ variant metal2vulkan-runtime::DispatchType::Concurrent Concurrent variant metal2vulkan-runtime::DispatchType::Serial Serial variant metal2vulkan-runtime::DrawKind::AttachmentFormats AttachmentFormats variant metal2vulkan-runtime::DrawKind::AttachmentRead AttachmentRead -variant metal2vulkan-runtime::DrawKind::DepthBiasClamp DepthBiasClamp variant metal2vulkan-runtime::DrawKind::DepthClamp DepthClamp variant metal2vulkan-runtime::DrawKind::DividedBaseInstance DividedBaseInstance variant metal2vulkan-runtime::DrawKind::FetchedAttachment FetchedAttachment diff --git a/docs/REFUSALS.md b/docs/REFUSALS.md index 850a12fe2..b1306a5e9 100644 --- a/docs/REFUSALS.md +++ b/docs/REFUSALS.md @@ -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` | 13: `crates/metal2vulkan-runtime/src/render_encoder.rs (attachment_reads, 3 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, 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, 3 sites)`, `crates/metal2vulkan-runtime/src/render_encoder.rs (draw)` (+8) | `-` | | `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 @@ -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, 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::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_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)`