rt: a draw of lines carries DeviceLineRasterization on every device; the raster test holds the diamond-exit rule's cells
What:
- RenderCommandEncoder::LINE_NOTE (PrecisionNote::DeviceLineRasterization)
is the static note of a draw of lines or a line strip, and of a draw of
triangles under the Lines fill mode, on every device.
- A render pipeline state no longer carries the note; it carried it only
under alpha to coverage or alpha to one.
- The note's text (artifact.rs, docs/API.md's catalogue, its items list
and the accepted difference on a line's tie-break, the runtime's README)
names its grounds, and keeps what it said of a state with alpha to
coverage or alpha to one: there the device's default line rule draws,
not Bresenham's mode. One note, both facts.
- The conformance side announces LINE_NOTE for each line draw and each
Lines fill mode set. The note is among replay's NATIVE_NOTES, so it
loosens the notices site alone.
- known-gaps-rt.tsv: the 12 primitive-type-restart-indices rows (NVIDIA,
RX 550, Iris Xe) cite the note. Their lines run through the boundary
point (3.5, 1.0).
- api_signatures.tsv gains the const's two rows
(scripts/api-signatures/signatures.py --check passes).
- Tests:
- raster.rs's Lines pass draws the triangle (-0.65, -0.675), (3, -0.675),
(-0.65, 3) through the target's own viewport. Its edges at x 1.4 and
y 6.7 lie inside the target with a pixel on each side, and strictly
inside the clip volume and the viewport.
- The pass holds the diamond-exit rule's cells exactly, column 1 and
row 6, on every device. A device that draws another cell fails with
the target drawn. It does not read the corner where the two lines'
ends meet.
- draw.rs's alpha-to-coverage test now holds that no state carries the
note, and that LINE_NOTE is it.
Why the note: a card draws a line pixel that differs from Metal's. The 12
ledgered rows are lines through the boundary point (3.5, 1.0): Metal on an
Apple M3 Max covers the lower pixel there, NVIDIA's driver the upper. The
runtime draws lines with VK_LINE_RASTERIZATION_MODE_BRESENHAM. Its diamond
is open, so no Vulkan control decides that pixel. The Vulkan
specification's section "Bresenham Line Segment Rasterization" also lets an
implementation's fragments "not deviate by more than one unit in either x or
y framebuffer coordinates from a corresponding fragment produced by the
diamond-exit rule", with a fragment count within one. Rule 1: a line's pixels
are the device's answer, so the operation carries a static note.
Why the test changed: the old Lines pass put its bottom edge at y 7.7 through
a viewport of y -0.3 and height 8. The Iris Xe drew none of row 7 there
(m3-max-63429 at ce998742d7, m3-max-63507 at 7c1baad228). With both edges
strictly inside the clip volume and the viewport, the Iris Xe draws the
diamond-exit rule's cells, as the other cards do. The fractional viewport's
cut row is a separate item, not a line rule.
Verified, column 1 and row 6 at the test's geometry:
- Iris Xe: m3-max-63735
- RTX 2080: m3-max-63736
- lavapipe: m3-max-63737
- RX 7900 XTX: m3-max-63707, at the same edges
The exact-cell form's legs are named with its sha.
Not a regression: the Lines pass came with a5fac6fa9b (11-20 22:51), and its
viewport moved at 2a36291a80 (23:32). No Iris run of the old pass passed.
This commit is contained in:
1 parent
1fbe4eacdb
commit
0f2067150f
12 files changed
+190
-110
No files matched your search
@@ -7287,18 +7287,18 @@ bicubic-texel-classes Iris(R) Xe divergent case/rgba16float/sampled 500 elements
|
||||
bicubic-texel-classes Iris(R) Xe divergent case/rgba16unorm/sampled 496 elements differ (F32), the largest difference 0.000007758848369121552 The device's arithmetic under the static note `bicubic-filter-arithmetic` (rule 1), within its stated bound. Metal's results lie on the format's grid: a sixteenth of a code for the 8-bit classes, a whole code for `RGBA16Unorm`, an exact `half` for `RGBA16Float`; at the six `RGBA16Float` samples where the sum is exactly halfway between two halves, Metal rounds away from zero. Ours is the unrounded `f32` sum of the sixteen decoded taps (the 2D routine, `lower::sampler::bicubic::routines`, `Plane`), and a `half` result is the device's narrowing of it. Every class takes Metal's arm, which the case's own tests hold in Metal's recording: `R32Float` the inner bilinear taps, which compare exactly; the clamp into [0, 1] of the unsigned normalized formats and into [-1, 1] of `RGBA8Snorm`; no clamp of `RGBA16Float`. Open: nothing; the difference is within Metal's precision, which rule 1 leaves to the note.
|
||||
bicubic-texel-classes Iris(R) Xe divergent case/rgba8snorm/sampled 756 elements differ (F32), the largest difference 0.00048828125 The device's arithmetic under the static note `bicubic-filter-arithmetic` (rule 1), within its stated bound. Metal's results lie on the format's grid: a sixteenth of a code for the 8-bit classes, a whole code for `RGBA16Unorm`, an exact `half` for `RGBA16Float`; at the six `RGBA16Float` samples where the sum is exactly halfway between two halves, Metal rounds away from zero. Ours is the unrounded `f32` sum of the sixteen decoded taps (the 2D routine, `lower::sampler::bicubic::routines`, `Plane`), and a `half` result is the device's narrowing of it. Every class takes Metal's arm, which the case's own tests hold in Metal's recording: `R32Float` the inner bilinear taps, which compare exactly; the clamp into [0, 1] of the unsigned normalized formats and into [-1, 1] of `RGBA8Snorm`; no clamp of `RGBA16Float`. Open: nothing; the difference is within Metal's precision, which rule 1 leaves to the note.
|
||||
bicubic-texel-classes Iris(R) Xe divergent case/rgba8unorm/sampled 494 elements differ (F32), the largest difference 0.000244140625 The device's arithmetic under the static note `bicubic-filter-arithmetic` (rule 1), within its stated bound. Metal's results lie on the format's grid: a sixteenth of a code for the 8-bit classes, a whole code for `RGBA16Unorm`, an exact `half` for `RGBA16Float`; at the six `RGBA16Float` samples where the sum is exactly halfway between two halves, Metal rounds away from zero. Ours is the unrounded `f32` sum of the sixteen decoded taps (the 2D routine, `lower::sampler::bicubic::routines`, `Plane`), and a `half` result is the device's narrowing of it. Every class takes Metal's arm, which the case's own tests hold in Metal's recording: `R32Float` the inner bilinear taps, which compare exactly; the clamp into [0, 1] of the unsigned normalized formats and into [-1, 1] of `RGBA8Snorm`; no clamp of `RGBA16Float`. Open: nothing; the difference is within Metal's precision, which rule 1 leaves to the note.
|
||||
primitive-type-restart-indices NVIDIA divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 3 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and NVIDIA's driver (the RTX 3090, 620.70.06) the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices NVIDIA divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 4 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and NVIDIA's driver (the RTX 3090, 620.70.06) the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices NVIDIA divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 5 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and NVIDIA's driver (the RTX 3090, 620.70.06) the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices NVIDIA divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 6 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and NVIDIA's driver (the RTX 3090, 620.70.06) the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices RX 550 divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 3 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and RADV on the RX 550 the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices RX 550 divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 4 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and RADV on the RX 550 the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices RX 550 divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 5 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and RADV on the RX 550 the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices RX 550 divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 6 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and RADV on the RX 550 the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices Iris(R) Xe divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 3 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and ANV on the Iris Xe the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices Iris(R) Xe divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 4 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and ANV on the Iris Xe the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices Iris(R) Xe divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 5 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and ANV on the Iris Xe the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices Iris(R) Xe divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 6 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and ANV on the Iris Xe the upper (row 0, column 3); lavapipe covers Metal's.
|
||||
primitive-type-restart-indices NVIDIA divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 3 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and NVIDIA's driver (the RTX 3090, 620.70.06) the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices NVIDIA divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 4 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and NVIDIA's driver (the RTX 3090, 620.70.06) the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices NVIDIA divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 5 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and NVIDIA's driver (the RTX 3090, 620.70.06) the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices NVIDIA divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 6 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and NVIDIA's driver (the RTX 3090, 620.70.06) the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices RX 550 divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 3 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and RADV on the RX 550 the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices RX 550 divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 4 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and RADV on the RX 550 the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices RX 550 divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 5 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and RADV on the RX 550 the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices RX 550 divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 6 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and RADV on the RX 550 the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices Iris(R) Xe divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 3 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and ANV on the Iris Xe the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices Iris(R) Xe divergent case/MTLPrimitiveTypeLine/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 4 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and ANV on the Iris Xe the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices Iris(R) Xe divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt16/texels 2 elements differ (U32), the largest difference 5 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and ANV on the Iris Xe the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
primitive-type-restart-indices Iris(R) Xe divergent case/MTLPrimitiveTypeLineStrip/MTLIndexTypeUInt32/texels 2 elements differ (U32), the largest difference 6 An accepted difference (docs/API.md section 10, Draws: a line's tie-break is the device's own): the line of vertices 0 and 1 runs exactly through the boundary point (3.5, 1.0), where it only touches the diamonds of the two pixels the point joins, and Vulkan's Bresenham diamond is open, so no Vulkan control decides which a conforming driver covers. With Bresenham's rule on (bresenhamLines, the runtime's floor), Metal on the Apple M3 Max covers the lower pixel and ANV on the Iris Xe the upper (row 0, column 3); lavapipe covers Metal's. Note `device-line-rasterization`, the static note of every draw of lines (`RenderCommandEncoder::LINE_NOTE`).
|
||||
format-footprints-plain-stragglers * refused case/MTLPixelFormatBGRA4Unorm/TextureBuffer/64x1x1/levels-1/samples-1/slices-1/usage-0x1/shared/size-and-align Err(Error::Refused("a texture buffer is made over a buffer the consumer places (Buffer::new_texture)")) refused: the consumer's contract (the runtime's README, Textures). Metal's `newTextureWithDescriptor:` of a texture buffer's descriptor, and a heap's size of one, take no buffer and allocate the texels themselves; the runtime makes a texture buffer only over a buffer the consumer places (`Buffer::new_texture`, one buffer view of its bytes, no copy), and refuses the descriptor at every other make and query (`Refusal::TextureBufferNotOverBuffer`). A consumer answers the call by placing a buffer of the texels' bytes and making the texture buffer over it; this side makes the descriptor's texture as Metal's call reads. Open: this side placing the buffer as a consumer does.
|
||||
integer-vertex-attributes llvmpipe divergent case/int_attribute_to_half4/Short/constant/rows 3 elements differ (F32), the largest difference 1 The device's own answer (rule 1): a vertex function's `half`-typed attribute is the fetched `float` rounded to `half` by the module's `OpFConvert` to 16 bits and back (lavapipe has no `shaderDenormPreserveFloat16`, so no float controls make the pair Metal's), and lavapipe's compiler folds the pair, handing the value on unrounded where Metal rounds it to nearest even: Metal reads 0x47000000, the device 0x46fffe00 at the first differing element. Note `native-half-conversion`, whose bound is a value not rounded at all.
|
||||
integer-vertex-attributes llvmpipe divergent case/int_attribute_to_half4/Short/per-vertex/rows 3 elements differ (F32), the largest difference 1 The device's own answer (rule 1): a vertex function's `half`-typed attribute is the fetched `float` rounded to `half` by the module's `OpFConvert` to 16 bits and back (lavapipe has no `shaderDenormPreserveFloat16`, so no float controls make the pair Metal's), and lavapipe's compiler folds the pair, handing the value on unrounded where Metal rounds it to nearest even: Metal reads 0x47000000, the device 0x46fffe00 at the first differing element. Note `native-half-conversion`, whose bound is a value not rounded at all.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -476,9 +476,9 @@ pub fn reads_opaque_black_border(spec: &crate::case::SamplerSpec) -> bool {
|
||||
/// - **resolves**: `device-rounded-resolve`;
|
||||
/// - **coverage**: the device's own conversion of a fragment's alpha to its coverage under
|
||||
/// alpha-to-coverage (`device-alpha-coverage`);
|
||||
/// - **lines**: the device's own line rule, the one form a state that enables alpha to coverage or
|
||||
/// alpha to one draws its lines in, Vulkan's Bresenham mode taking neither
|
||||
/// (`device-line-rasterization`), announced by every such state whether or not it draws lines;
|
||||
/// - **lines**: the device's own line rule, within Vulkan's allowance of one pixel from the
|
||||
/// diamond-exit rule (`device-line-rasterization`), announced by every draw of lines or a line
|
||||
/// strip and every `Lines` fill mode set;
|
||||
/// - **depth bias**: the device's own slope measure and unit of a draw of triangles under a depth
|
||||
/// bias (`device-depth-bias`), announced by every such draw;
|
||||
/// - **visibility results**: the device's own precise occlusion count of a `Boolean` or `Counting`
|
||||
|
||||
@@ -368,8 +368,10 @@ pub struct RtSide<'a> {
|
||||
/// [`Side::announced`] answers too.
|
||||
drawn: BTreeSet<usize>,
|
||||
/// The static notes of what a pass the case encoded set beside its pipeline states: a depth
|
||||
/// bias other than 0 (`RenderCommandEncoder::DEPTH_BIAS_NOTE`) and each depth-stencil state's
|
||||
/// (`DepthStencilState::precision_note`); and of each texture and sampler state the case made
|
||||
/// bias other than 0 (`RenderCommandEncoder::DEPTH_BIAS_NOTE`), a draw of lines or a line
|
||||
/// strip and the `Lines` fill mode (`RenderCommandEncoder::LINE_NOTE`), and each
|
||||
/// depth-stencil state's (`DepthStencilState::precision_note`); and of each texture and
|
||||
/// sampler state the case made
|
||||
/// (`Texture::precision_note`, `SamplerState::precision_note`), which [`Side::announced`]
|
||||
/// answers too.
|
||||
encoder_notes: BTreeSet<rt::PrecisionNote>,
|
||||
|
||||
@@ -18,6 +18,7 @@ use crate::values::{
|
||||
StoreActionOptions, VisibilityResultMode, VisibilityResultType,
|
||||
};
|
||||
use crate::work::Plane;
|
||||
use metal2vulkan::metal::{PrimitiveType, TriangleFillMode};
|
||||
use metal2vulkan_runtime as rt;
|
||||
|
||||
/// A typed error of the runtime as the failure it records.
|
||||
@@ -335,6 +336,24 @@ impl RtSide<'_> {
|
||||
mode: VisibilityResultMode::Boolean | VisibilityResultMode::Counting,
|
||||
..
|
||||
} => Some(rt::RenderCommandEncoder::VISIBILITY_NOTE),
|
||||
RenderStep::FillMode(TriangleFillMode::Lines) => {
|
||||
Some(rt::RenderCommandEncoder::LINE_NOTE)
|
||||
}
|
||||
RenderStep::Draw { primitive, .. }
|
||||
| RenderStep::DrawInstanced { primitive, .. }
|
||||
| RenderStep::DrawPlain { primitive, .. }
|
||||
| RenderStep::DrawIndexed { primitive, .. }
|
||||
| RenderStep::DrawIndexedPlain { primitive, .. }
|
||||
| RenderStep::DrawIndexedInstanced { primitive, .. }
|
||||
| RenderStep::DrawIndirect { primitive, .. }
|
||||
| RenderStep::DrawIndexedIndirect { primitive, .. }
|
||||
if matches!(
|
||||
primitive,
|
||||
PrimitiveType::Line | PrimitiveType::LineStrip
|
||||
) =>
|
||||
{
|
||||
Some(rt::RenderCommandEncoder::LINE_NOTE)
|
||||
}
|
||||
_ => None,
|
||||
});
|
||||
let notes: Vec<rt::PrecisionNote> = notes.collect();
|
||||
|
||||
@@ -3082,9 +3082,12 @@ cache is answered compile-required on both.
|
||||
(`bresenhamLines`, Floor). The line class's `VkPipeline` chains
|
||||
`VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT`, except for a state that enables alpha to coverage or
|
||||
alpha to one, which Vulkan's Bresenham mode does not take: its lines are drawn by the device's
|
||||
default rule, the rectangle of the line's width on a device whose `strictLines` is set, and the
|
||||
state carries `PrecisionNote::DeviceLineRasterization`. Where a line only touches a pixel's
|
||||
diamond at its vertex, which pixel it covers is the device's own (docs/API.md, section 10).
|
||||
default rule, the rectangle of the line's width on a device whose `strictLines` is set. Either
|
||||
way a line's pixels are the device's: Vulkan's Bresenham mode lets a fragment lie up to one
|
||||
pixel in x or y from the diamond-exit rule's, and a draw of lines, or of triangles under the
|
||||
`Lines` fill mode, carries `PrecisionNote::DeviceLineRasterization`
|
||||
(`RenderCommandEncoder::LINE_NOTE`). Where a line only touches a pixel's diamond at its vertex,
|
||||
which pixel it covers is the device's own (docs/API.md, section 10).
|
||||
- A post-tessellation vertex function's state draws its patches through the device's tessellator
|
||||
(`tessellationShader`, Floor). Its one `VkPipeline` is the patch class's, made with the state:
|
||||
the translator's synthesized vertex stage (each patch one vertex of a `PATCH_LIST` of one control
|
||||
|
||||
@@ -55,7 +55,8 @@
|
||||
//! A line is drawn by Bresenham's rule, which is Metal's (`bresenhamLines`, Floor): the line
|
||||
//! class's `VkPipeline` chains `VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT`, except under alpha to
|
||||
//! coverage or alpha to one, which the mode does not take, where the device's default rule draws
|
||||
//! it (`PrecisionNote::DeviceLineRasterization`).
|
||||
//! it. Either way its pixels are the device's, within Vulkan's allowance of the diamond-exit rule,
|
||||
//! which a draw of lines records (`RenderCommandEncoder::LINE_NOTE`).
|
||||
//!
|
||||
//! A content whose vertex function is post-tessellation draws patches alone, so its one
|
||||
//! `VkPipeline` is the patch class's, made with the state: the translator's synthesized vertex and
|
||||
@@ -223,9 +224,8 @@ pub(crate) struct RenderCompiled {
|
||||
/// Metal rasterizes no point of such a function and runs its vertex function all the same
|
||||
/// (`metal2vulkan::pipeline::GraphicsState::writes_point_size`).
|
||||
rasterizes_points: bool,
|
||||
/// The translator's notes of where the pipeline's answers may differ from Metal's, its
|
||||
/// functions' constexpr samplers' (`constexpr_notes`), and `DeviceLineRasterization` where its
|
||||
/// lines are drawn by the device's default rule (`lines_by_device_rule`).
|
||||
/// The translator's notes of where the pipeline's answers may differ from Metal's, and its
|
||||
/// functions' constexpr samplers' (`constexpr_notes`).
|
||||
notes: Vec<PrecisionNote>,
|
||||
/// What a draw supplies.
|
||||
pub(crate) draws: Draws,
|
||||
@@ -464,9 +464,7 @@ impl crate::Device {
|
||||
|
||||
/// Whether a content's lines are drawn by the device's default rule rather than Bresenham's:
|
||||
/// its state enables alpha to coverage or alpha to one, which Vulkan's Bresenham mode does not
|
||||
/// take (`VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766`). Decided by the
|
||||
/// descriptor alone, so a state of it carries `PrecisionNote::DeviceLineRasterization` whether or
|
||||
/// not it draws lines.
|
||||
/// take (`VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766`).
|
||||
fn lines_by_device_rule(fixed: &Fixed) -> bool {
|
||||
fixed.alpha_to_coverage || fixed.alpha_to_one
|
||||
}
|
||||
@@ -1084,10 +1082,6 @@ impl RenderCompiled {
|
||||
});
|
||||
notes.extend(stage.precision_notes.iter().copied());
|
||||
}
|
||||
let fixed = Fixed::of(&pipeline);
|
||||
if lines_by_device_rule(&fixed) {
|
||||
notes.push(PrecisionNote::DeviceLineRasterization);
|
||||
}
|
||||
notes.sort_unstable();
|
||||
notes.dedup();
|
||||
core.counters.rise(Gauge::RenderContents);
|
||||
@@ -1098,7 +1092,7 @@ impl RenderCompiled {
|
||||
let mut compiled = RenderCompiled {
|
||||
core: Arc::clone(core),
|
||||
stages,
|
||||
fixed,
|
||||
fixed: Fixed::of(&pipeline),
|
||||
primary: vk::Pipeline::null(),
|
||||
later: Mutex::new(Vec::new()),
|
||||
rasterizes_points: pipeline.graphics.writes_point_size
|
||||
@@ -1261,7 +1255,8 @@ impl RenderCompiled {
|
||||
// Vulkan's Bresenham mode does not take
|
||||
// (`VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766`; the runtime enables no
|
||||
// sample shading, the third it names): such a state draws its lines by the device's
|
||||
// default rule (`PrecisionNote::DeviceLineRasterization`, of `lines_by_device_rule`).
|
||||
// default rule (`lines_by_device_rule`). Either way a draw of lines records
|
||||
// `RenderCommandEncoder::LINE_NOTE`.
|
||||
let mut line = vk::PipelineRasterizationLineStateCreateInfoEXT::default()
|
||||
.line_rasterization_mode(vk::LineRasterizationModeEXT::BRESENHAM);
|
||||
let draws_lines = topology == vk::PrimitiveTopology::LINE_LIST || raster.lines;
|
||||
@@ -1346,9 +1341,8 @@ impl RenderPipelineState {
|
||||
/// [`PrecisionNote::SwizzledOpaqueBlackBorder`] where a function samples through a constexpr
|
||||
/// sampler whose address mode reads an opaque-black border (decided by the sampler's own
|
||||
/// constants, as [`SamplerState::precision_note`](crate::SamplerState::precision_note) is by
|
||||
/// its descriptor), and [`PrecisionNote::DeviceLineRasterization`] where the descriptor
|
||||
/// enables alpha to coverage or alpha to one, under which the state's lines are drawn by the
|
||||
/// device's default rule, not Bresenham's; empty where they match.
|
||||
/// its descriptor); empty where they match. A draw's lines carry their own note
|
||||
/// ([`RenderCommandEncoder::LINE_NOTE`](crate::RenderCommandEncoder::LINE_NOTE)).
|
||||
pub fn precision_notes(&self) -> Vec<PrecisionNote> {
|
||||
self.inner.compiled.notes.clone()
|
||||
}
|
||||
|
||||
@@ -1365,10 +1365,17 @@ impl RenderCommandEncoder {
|
||||
}
|
||||
}
|
||||
|
||||
/// The static precision note of a draw of lines or a line strip, and of a draw of triangles
|
||||
/// under the `Lines` fill mode ([`set_triangle_fill_mode`](Self::set_triangle_fill_mode)), on
|
||||
/// every device: the line's pixels are the device's line rule's
|
||||
/// ([`PrecisionNote::DeviceLineRasterization`]).
|
||||
pub const LINE_NOTE: PrecisionNote = PrecisionNote::DeviceLineRasterization;
|
||||
|
||||
/// `setTriangleFillMode:` for the encoder's later draws: `Fill`, Metal's default, or `Lines`,
|
||||
/// each triangle's edges drawn as lines 1 pixel wide by Bresenham's rule, as the encoder's
|
||||
/// lines are, through a `VkPipeline` of the draw's class made for it by the content's first
|
||||
/// draw under it. Draws of lines and points take no fill mode, as in Metal.
|
||||
/// lines are ([`LINE_NOTE`](Self::LINE_NOTE)), through a `VkPipeline` of the draw's class made
|
||||
/// for it by the content's first draw under it. Draws of lines and points take no fill mode,
|
||||
/// as in Metal.
|
||||
///
|
||||
/// Err: [`Gap::Draw`] of [`DrawKind::FillMode`] for `Lines` on a device without
|
||||
/// `fillModeNonSolid` (`floor`'s fill modes) and for the mode of raw value 2, which no SDK
|
||||
|
||||
@@ -616,12 +616,12 @@ pub(crate) mod on_device {
|
||||
});
|
||||
}
|
||||
|
||||
/// A state that enables alpha to coverage or alpha to one carries
|
||||
/// `PrecisionNote::DeviceLineRasterization`, its lines drawn by the device's default rule,
|
||||
/// which Vulkan's Bresenham mode leaves for such a state; a plain state carries none, its lines
|
||||
/// drawn by Bresenham's rule. Each draws its line across row 2.
|
||||
/// A plain state draws its lines by Bresenham's rule, and one that enables alpha to coverage or
|
||||
/// alpha to one by the device's default rule, which Vulkan's Bresenham mode leaves for such a
|
||||
/// state. Neither state carries `PrecisionNote::DeviceLineRasterization`: the draw of lines
|
||||
/// does, on every device (`RenderCommandEncoder::LINE_NOTE`). Each draws its line across row 2.
|
||||
#[test]
|
||||
fn every_device_notes_the_device_line_rule_under_alpha_to_coverage_or_one() {
|
||||
fn every_device_draws_lines_under_alpha_to_coverage_or_one() {
|
||||
let Some(library) = examples() else {
|
||||
return;
|
||||
};
|
||||
@@ -631,6 +631,7 @@ pub(crate) mod on_device {
|
||||
let mut one = plain.clone();
|
||||
one.alpha_to_one = true;
|
||||
let note = crate::PrecisionNote::DeviceLineRasterization;
|
||||
assert_eq!(crate::RenderCommandEncoder::LINE_NOTE, note);
|
||||
each_device("draw_line_rule", |name, _, device| {
|
||||
let y = 1.0 - 2.5 / 4.0;
|
||||
let mut buffers = Buffers::new(&device);
|
||||
@@ -638,16 +639,15 @@ pub(crate) mod on_device {
|
||||
let colors = buffers.of(&device, &floats(&[GREEN, GREEN].concat()));
|
||||
let queue = device.new_command_queue(4).expect("a queue");
|
||||
let draw = |result: Result<(), Error>| result.unwrap_or_else(|e| panic!("{name}: {e}"));
|
||||
for (what, d, noted) in [
|
||||
("plain", &plain, false),
|
||||
("alpha to coverage", &coverage, true),
|
||||
("alpha to one", &one, true),
|
||||
for (what, d) in [
|
||||
("plain", &plain),
|
||||
("alpha to coverage", &coverage),
|
||||
("alpha to one", &one),
|
||||
] {
|
||||
let state = state(name, &device, d);
|
||||
assert_eq!(
|
||||
state.precision_notes().contains(¬e),
|
||||
noted,
|
||||
"{name}: {what}: the device line rule's note"
|
||||
assert!(
|
||||
!state.precision_notes().contains(¬e),
|
||||
"{name}: {what}: the line note on the state"
|
||||
);
|
||||
let color = target(
|
||||
&device,
|
||||
@@ -669,7 +669,7 @@ pub(crate) mod on_device {
|
||||
assert_eq!(texels[i..i + 4], rgba8(GREEN), "{name}: {what}: ({x}, 2)");
|
||||
}
|
||||
}
|
||||
println!("{name}: the device line rule noted under alpha to coverage and alpha to one");
|
||||
println!("{name}: lines drawn plain, under alpha to coverage and under alpha to one");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,13 +6,15 @@
|
||||
//! - A triangle over the whole target in front of the near plane (z -0.5) draws nothing under
|
||||
//! `Clip` and every texel under `Clamp`, which keeps it at the near plane (the conformance case
|
||||
//! `render-state-depth-clip`).
|
||||
//! - Under `Lines`, where the device has `fillModeNonSolid`, the triangle at z 0.5 through a
|
||||
//! viewport 0.4 pixels right of and 0.3 above the target's corner draws the two edges that lie
|
||||
//! inside the target, column 0 and row 7, and nothing inside them; without the feature the mode
|
||||
//! is `DrawKind::FillMode` and the encoder's mode stays `Fill`. Each edge crosses its pixels'
|
||||
//! diamonds off their centers and corners, and both start strictly inside the corner pixel's, so
|
||||
//! Bresenham's diamond-exit rule draws them on every device: a line through texel centers ties
|
||||
//! at each diamond's corners, where lavapipe drew row 7 not at all (m3-max-62049).
|
||||
//! - Under `Lines`, where the device has `fillModeNonSolid`, a triangle at z 0.5 whose left and
|
||||
//! bottom edges lie inside the target, at x 1.4 and y 6.7, and strictly inside the clip volume
|
||||
//! and the viewport, draws those two edges and nothing inside them; without the feature the mode
|
||||
//! is `DrawKind::FillMode`, the encoder's mode stays `Fill`, and the triangle over the whole
|
||||
//! target fills it. Each edge crosses its pixels' diamonds off their centers and corners (a line
|
||||
//! through texel centers ties at each diamond's corners, where lavapipe drew such a row not at
|
||||
//! all, m3-max-62049), so the diamond-exit rule, Metal's, draws column 1 and row 6, and the test
|
||||
//! holds exactly those, printing the target where a device draws otherwise. The corner where the
|
||||
//! edges meet is not read: there the two lines' ends are each the device's.
|
||||
//! - The first draw under each raster state makes one pipeline, a first-use wait of the raster
|
||||
//! site; a later encoder's draw under the same state makes none.
|
||||
|
||||
@@ -26,19 +28,63 @@ mod on_device {
|
||||
use crate::{
|
||||
Buffer, ColorAttachmentDescriptor, DepthClipMode, DrawKind, Error, FunctionDescriptor, Gap,
|
||||
PixelFormat, PrimitiveType, RenderPipelineDescriptor, StageSource, TextureUsage,
|
||||
TriangleFillMode, Viewport,
|
||||
TriangleFillMode,
|
||||
};
|
||||
use metal2vulkan::device::VkFeature;
|
||||
use metal2vulkan_devtools::engine_dir;
|
||||
|
||||
const WHITE: [f32; 4] = [1.0; 4];
|
||||
|
||||
/// Holds that the Lines pass's two edges in `texels` (the target's RGBA8 bytes) are the
|
||||
/// diamond-exit rule's, Metal's: column 1 white in every row above row 5, row 6 white in every
|
||||
/// column from 3, and nothing else white outside the corner where they meet. Panics naming
|
||||
/// `name`, with the target drawn, otherwise.
|
||||
fn lines_at(name: &str, texels: &[u8]) {
|
||||
let white = |x: u32, y: u32| {
|
||||
let i = ((y * SIDE + x) * 4) as usize;
|
||||
match texels[i..i + 4] {
|
||||
[255, 255, 255, 255] => true,
|
||||
[0, 0, 0, 255] => false,
|
||||
ref other => panic!("{name}: ({x}, {y}) reads {other:?}"),
|
||||
}
|
||||
};
|
||||
// The target's rows top first, `#` drawn, for a failure's message.
|
||||
let drawn: Vec<String> = (0..SIDE)
|
||||
.map(|y| {
|
||||
(0..SIDE)
|
||||
.map(|x| if white(x, y) { '#' } else { '.' })
|
||||
.collect()
|
||||
})
|
||||
.collect();
|
||||
for y in 0..SIDE {
|
||||
for x in 0..SIDE {
|
||||
let corner = x < 3 && y >= 5;
|
||||
let edge = (x == 1 && y < 5) || (y == 6 && x >= 3);
|
||||
assert!(
|
||||
corner || edge == white(x, y),
|
||||
"{name}: ({x}, {y}) {}; the diamond-exit rule draws column 1 above row 5 and \
|
||||
row 6 from column 3: {drawn:?}",
|
||||
if edge { "not drawn" } else { "drawn" }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The triangle `(-1, -1)`, `(3, -1)`, `(-1, 3)` of clip space, which covers the clip square,
|
||||
/// at depth `z`: `cfb_depth_vertex`'s positions.
|
||||
fn triangle(z: f32) -> Vec<u8> {
|
||||
floats(&[-1.0, -1.0, z, 1.0, 3.0, -1.0, z, 1.0, -1.0, 3.0, z, 1.0])
|
||||
}
|
||||
|
||||
/// The triangle `(-0.65, -0.675)`, `(3, -0.675)`, `(-0.65, 3)` of clip space at depth `z`:
|
||||
/// through the target's viewport, its left edge at x 1.4 and its bottom edge at y 6.7, each
|
||||
/// inside the clip volume, and its third edge past the target's top left.
|
||||
fn edge_triangle(z: f32) -> Vec<u8> {
|
||||
floats(&[
|
||||
-0.65, -0.675, z, 1.0, 3.0, -0.675, z, 1.0, -0.65, 3.0, z, 1.0,
|
||||
])
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_device_draws_clamped_and_edge_triangles_through_pipelines_made_at_first_use() {
|
||||
let Some(library) = library(&engine_dir().join("cfb_sample_depth.ll")) else {
|
||||
@@ -56,9 +102,13 @@ mod on_device {
|
||||
let state = state(name, &device, &d);
|
||||
let mut buffers = Buffers::new(&device);
|
||||
let near = buffers.of(&device, &triangle(-0.5));
|
||||
let inside = buffers.of(&device, &triangle(0.5));
|
||||
let non_solid = (device.core().translator.profile().enabled().features)
|
||||
.contains(&VkFeature::FillModeNonSolid);
|
||||
// The edges where the device draws them; the whole target where it fills instead.
|
||||
let inside = match non_solid {
|
||||
true => buffers.of(&device, &edge_triangle(0.5)),
|
||||
false => buffers.of(&device, &triangle(0.5)),
|
||||
};
|
||||
let queue = device.new_command_queue(4).expect("a queue");
|
||||
let draw = |result: Result<(), Error>| result.unwrap_or_else(|e| panic!("{name}: {e}"));
|
||||
// Each pass in an encoder of its own, so each sets its modes from Metal's defaults.
|
||||
@@ -99,18 +149,6 @@ mod on_device {
|
||||
}
|
||||
(other, _) => panic!("{name}: {fill:?}: {other:?}"),
|
||||
}
|
||||
if lines && non_solid {
|
||||
// Clip space's left and bottom edges at x 0.4 and y 7.7, inside column 0's
|
||||
// and row 7's diamonds.
|
||||
draw(encoder.set_viewport(Viewport {
|
||||
origin_x: 0.4,
|
||||
origin_y: -0.3,
|
||||
width: f64::from(SIDE),
|
||||
height: f64::from(SIDE),
|
||||
znear: 0.0,
|
||||
zfar: 1.0,
|
||||
}));
|
||||
}
|
||||
draw(encoder.draw_primitives(PrimitiveType::Triangle, 0, 3, 1, 0));
|
||||
encoder.end_encoding();
|
||||
}
|
||||
@@ -130,22 +168,23 @@ mod on_device {
|
||||
assert_eq!(read(&colors[0], 4), all(BLACK), "{name}: clipped");
|
||||
assert_eq!(read(&colors[1], 4), all(WHITE), "{name}: clamped");
|
||||
assert_eq!(read(&colors[2], 4), all(WHITE), "{name}: clamped again");
|
||||
let edges = match non_solid {
|
||||
true => texels(|x, y| match x == 0 || y == SIDE - 1 {
|
||||
true => WHITE,
|
||||
false => BLACK,
|
||||
}),
|
||||
// The mode refused, the triangle fills the target through the whole viewport.
|
||||
false => all(WHITE),
|
||||
let edges = read(&colors[3], 4);
|
||||
let drawn = match non_solid {
|
||||
true => {
|
||||
lines_at(name, &edges);
|
||||
"its two edges drawn, column 1 and row 6 (the diamond-exit rule's), 1 pipeline \
|
||||
more"
|
||||
.to_owned()
|
||||
}
|
||||
false => {
|
||||
// The mode refused, the triangle fills the target through the whole viewport.
|
||||
assert_eq!(edges, all(WHITE), "{name}: filled");
|
||||
"refused (FillMode), filled".to_owned()
|
||||
}
|
||||
};
|
||||
assert_eq!(read(&colors[3], 4), edges, "{name}: the edges");
|
||||
println!(
|
||||
"{name}: a near triangle clipped, then clamped through 1 pipeline made at first \
|
||||
use; fillModeNonSolid {non_solid}: {} under Lines",
|
||||
match non_solid {
|
||||
true => "its two edges inside the target drawn, 1 pipeline more",
|
||||
false => "refused (FillMode), filled",
|
||||
}
|
||||
use; fillModeNonSolid {non_solid}: {drawn} under Lines"
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2086,16 +2086,21 @@ pub enum PrecisionNote {
|
||||
/// Validation derives no tolerance from it: a difference stays a mismatch, which the note
|
||||
/// explains.
|
||||
SwizzledOpaqueBlackBorder,
|
||||
/// A render pipeline state that enables alpha to coverage or alpha to one draws its lines by
|
||||
/// the device's default rule, not Bresenham's: Vulkan's Bresenham mode takes neither
|
||||
/// (`VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766`). Metal covers the pixels
|
||||
/// whose diamond a line exits, which Bresenham's mode is; a device whose `strictLines` is set
|
||||
/// (lavapipe, NVIDIA's driver) covers the rectangle of the line's width instead, so the pixels
|
||||
/// at a line's two ends, and on either side of a pixel boundary the line runs along, may
|
||||
/// differ from Metal's. Every other state draws its lines by Bresenham's rule and records no
|
||||
/// note. Static, decided by the descriptor alone: no translated stage records it; on
|
||||
/// `metal2vulkan-runtime` such a state carries it among its notes (`precision_notes`),
|
||||
/// whether or not it draws lines.
|
||||
/// A draw of lines (a line or a line strip, or a triangle's edges under the `Lines` fill mode)
|
||||
/// covers the pixels the device's line rule gives, on every device. Metal covers the pixels
|
||||
/// whose diamond a line exits. Vulkan's Bresenham mode, which draws lines elsewhere, lets an
|
||||
/// implementation's fragment lie up to one pixel in x or y from the diamond-exit rule's, and
|
||||
/// its fragment count differ by one (the Vulkan specification, "Bresenham Line Segment
|
||||
/// Rasterization"), and its diamond is open, so no Vulkan control decides the pixel of a line
|
||||
/// that only touches a diamond's vertex: where a line of the conformance case
|
||||
/// `primitive-type-restart-indices` runs through the boundary point (3.5, 1.0), Metal on an
|
||||
/// Apple M3 Max covers the lower pixel and NVIDIA's driver the upper. A state that enables alpha to coverage or alpha to one draws its lines by the device's
|
||||
/// default rule instead, as Vulkan's Bresenham mode takes neither
|
||||
/// (`VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766`): a device whose
|
||||
/// `strictLines` is set (lavapipe, NVIDIA's driver) covers the rectangle of the line's width,
|
||||
/// so the pixels at a line's two ends, and on either side of a pixel boundary the line runs
|
||||
/// along, may differ from Metal's. Static, of the draw: no translated stage records it; on
|
||||
/// `metal2vulkan-runtime` a draw of lines carries it (`RenderCommandEncoder::LINE_NOTE`).
|
||||
///
|
||||
/// Validation derives no tolerance from it: a difference stays a mismatch, which the note
|
||||
/// explains.
|
||||
|
||||
@@ -53,6 +53,7 @@ assoc-const metal2vulkan-runtime::IndirectCommandType::DRAW_MESH_THREADS pub con
|
||||
assoc-const metal2vulkan-runtime::IndirectCommandType::DRAW_PATCHES pub const DRAW_PATCHES: IndirectCommandType
|
||||
assoc-const metal2vulkan-runtime::PixelFormatInfo::INVALID pub const INVALID: PixelFormatInfo
|
||||
assoc-const metal2vulkan-runtime::RenderCommandEncoder::DEPTH_BIAS_NOTE pub const DEPTH_BIAS_NOTE: PrecisionNote
|
||||
assoc-const metal2vulkan-runtime::RenderCommandEncoder::LINE_NOTE pub const LINE_NOTE: PrecisionNote
|
||||
assoc-const metal2vulkan-runtime::RenderCommandEncoder::VISIBILITY_NOTE pub const VISIBILITY_NOTE: PrecisionNote
|
||||
assoc-const metal2vulkan-runtime::ResourceUsage::READ pub const READ: ResourceUsage
|
||||
assoc-const metal2vulkan-runtime::ResourceUsage::SAMPLE pub const SAMPLE: ResourceUsage
|
||||
@@ -279,6 +280,7 @@ assoc-const-value metal2vulkan-runtime::IndirectCommandType::DRAW_MESH_THREADS I
|
||||
assoc-const-value metal2vulkan-runtime::IndirectCommandType::DRAW_PATCHES IndirectCommandType(1 <<2)
|
||||
assoc-const-value metal2vulkan-runtime::PixelFormatInfo::INVALID PixelFormatInfo
|
||||
assoc-const-value metal2vulkan-runtime::RenderCommandEncoder::DEPTH_BIAS_NOTE PrecisionNote::DeviceDepthBias
|
||||
assoc-const-value metal2vulkan-runtime::RenderCommandEncoder::LINE_NOTE PrecisionNote::DeviceLineRasterization
|
||||
assoc-const-value metal2vulkan-runtime::RenderCommandEncoder::VISIBILITY_NOTE PrecisionNote::DeviceOcclusionCount
|
||||
assoc-const-value metal2vulkan-runtime::ResourceUsage::READ ResourceUsage(1)
|
||||
assoc-const-value metal2vulkan-runtime::ResourceUsage::SAMPLE ResourceUsage(4)
|
||||
|
||||
|
Can't render this file because it is too large.
|
+23
-14
@@ -1676,9 +1676,7 @@ the translated module, the pixel format, the descriptor or the state, on every d
|
||||
|
||||
- `ComputePipelineState::precision_notes` and `RenderPipelineState::precision_notes`: the
|
||||
translator's notes of the state's modules, with `SwizzledOpaqueBlackBorder` where a function
|
||||
samples through a constexpr sampler whose address mode reads an opaque-black border, and
|
||||
`DeviceLineRasterization` where a render pipeline's descriptor enables alpha to coverage or
|
||||
alpha to one;
|
||||
samples through a constexpr sampler whose address mode reads an opaque-black border;
|
||||
- `Texture::precision_note`: `CompressedTexelDecode` where the texture's own pixel format is
|
||||
block-compressed;
|
||||
- `SamplerState::precision_note`: `SwizzledOpaqueBlackBorder` where an address mode reads an
|
||||
@@ -1688,8 +1686,10 @@ the translated module, the pixel format, the descriptor or the state, on every d
|
||||
resolves;
|
||||
- `BlitCommandEncoder::GENERATE_MIPMAPS_NOTE` (`DeviceFilteredMipmaps`, of `generate_mipmaps`),
|
||||
`RenderCommandEncoder::DEPTH_BIAS_NOTE` (`DeviceDepthBias`, of a draw of triangles under a depth
|
||||
bias) and `RenderCommandEncoder::VISIBILITY_NOTE` (`DeviceOcclusionCount`, of a `Boolean` or
|
||||
`Counting` visibility result).
|
||||
bias), `RenderCommandEncoder::LINE_NOTE` (`DeviceLineRasterization`, of a draw of lines or a line
|
||||
strip, and of a draw of triangles under the `Lines` fill mode) and
|
||||
`RenderCommandEncoder::VISIBILITY_NOTE` (`DeviceOcclusionCount`, of a `Boolean` or `Counting`
|
||||
visibility result).
|
||||
|
||||
A note is never fatal: the work runs on every device. The runtime prints and sends no note; a
|
||||
consumer reads them through these items. The translator's own API gives a stage's notes
|
||||
@@ -2526,14 +2526,22 @@ bound.
|
||||
NVIDIA driver reads `(0, 0, 0, 1)`, where Metal reads the border colour in the format's channels
|
||||
through the swizzle. A device with the feature reads Metal's texel.
|
||||
- `metal2vulkan-degrade-device-line-rasterization` (precision).
|
||||
`PrecisionNote::DeviceLineRasterization`: A render pipeline state that enables alpha to coverage
|
||||
or alpha to one, which carries it among its notes (`precision_notes`), decided by its descriptor
|
||||
alone. Its lines are drawn by the device's default rule, not Bresenham's, which Vulkan takes with
|
||||
neither (`VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766`). Metal covers the
|
||||
pixels whose diamond a line exits; a device whose `strictLines` is set (lavapipe, NVIDIA's
|
||||
driver) covers the rectangle of the line's width instead, so the pixels at a line's two ends,
|
||||
and on either side of a pixel boundary the line runs along, may differ from Metal's. Every other
|
||||
state draws its lines by Bresenham's rule (`bresenhamLines`, the runtime's floor).
|
||||
`PrecisionNote::DeviceLineRasterization`: A draw of lines (a line or a line strip, or a
|
||||
triangle's edges under the `Lines` fill mode), on every device, which carries it
|
||||
(`RenderCommandEncoder::LINE_NOTE`). Metal covers the pixels whose diamond a line exits. Lines
|
||||
draw by Vulkan's Bresenham mode (`bresenhamLines`, the runtime's floor), which lets an
|
||||
implementation's fragment lie up to one pixel in x or y from the diamond-exit rule's, and its
|
||||
fragment count differ by one (the Vulkan specification, "Bresenham Line Segment
|
||||
Rasterization"), and whose diamond is open, so no Vulkan control decides the pixel of a line that
|
||||
only touches a diamond's vertex: where a line of the conformance case
|
||||
`primitive-type-restart-indices` runs through the boundary point (3.5, 1.0), Metal on an Apple M3
|
||||
Max covers the lower pixel and NVIDIA's driver the upper (the accepted difference "A line's
|
||||
tie-break is the device's own", section 10). A state that enables alpha to coverage or alpha to one draws its lines by the device's default
|
||||
rule instead, as Vulkan's Bresenham mode takes neither
|
||||
(`VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766`): a device whose `strictLines`
|
||||
is set (lavapipe, NVIDIA's driver) covers the rectangle of the line's width, so the pixels at a
|
||||
line's two ends, and on either side of a pixel boundary the line runs along, may differ from
|
||||
Metal's.
|
||||
- `metal2vulkan-degrade-device-pack-conversion` (precision). `PrecisionNote::DevicePackConversion`:
|
||||
Native device maths (a conversion): `air.pack` or `air.unpack` of a normalized format is the
|
||||
device's: `GLSL.std.450`'s `Pack`/`Unpack` `Unorm4x8`, `Snorm4x8`, `Unorm2x16` and `Snorm2x16`,
|
||||
@@ -2611,7 +2619,8 @@ named states the rule in full.
|
||||
no pixel whose centre lies on or past that edge and culls no point at the clip volume (the
|
||||
conformance case `point-viewport-coverage`).
|
||||
- **A line's tie-break is the device's own.** Lines draw by Bresenham's rule, which is Metal's
|
||||
(`bresenhamLines`, the runtime's floor): the pixels whose diamond the line exits. Vulkan's
|
||||
(`bresenhamLines`, the runtime's floor): the pixels whose diamond the line exits, each within
|
||||
the one pixel Vulkan allows an implementation (`PrecisionNote::DeviceLineRasterization`). Vulkan's
|
||||
diamond is open (`|p - x| + |q - y| < 0.5`), so a line that only touches a diamond's vertex
|
||||
exits neither diamond the vertex joins, and no Vulkan control decides which pixel a conforming
|
||||
driver covers there. Measured, where a line of the conformance case
|
||||
|
||||
Reference in new issue
Block a user