Snapshot reads with no barrier: API.md's accepted difference covers writers
docs/API.md's accepted difference for a draw that reads its own pass's color at its own pixels with no barrier now covers a draw that writes the color too: it reads what the draws before it wrote where the runtime takes no copy for it (in place, or through a snapshot where the device takes that route and the snapshot costs no more than the copy: a surface's reader always, a private texture's by the area rule), else the copy, the M3 Max's texels. Its lead-in is the slug the pass-start-barrier read rows name. FAST-PATHS.md's row and texture/attached_reads.rs say the same, each naming both answers. Verified: docs only; the conformance unit test that the slug exists runs in the 780M job.
This commit is contained in:
1 parent
3e620240f2
commit
df9ae6b02d
3 files changed
+42
-23
No files matched your search
@@ -51,8 +51,11 @@
|
||||
//! there: its other primitives' at the pixel it reads, which nothing orders before a sampled
|
||||
//! read (the Rasterization Order section orders fragment operations and color writes alone), a
|
||||
//! data race, which Vulkan forbids ("Applications must not cause a data race", the Shader
|
||||
//! Memory Access Ordering section). Such a draw reads the copy before a barrier, a correctness
|
||||
//! fallback; after one, it reads in place through a snapshot where the device can (below).
|
||||
//! Memory Access Ordering section). Such a draw reads in place through a snapshot where the
|
||||
//! device can and the snapshot costs no more than the copy (`render/snapshot.rs`; below), with
|
||||
//! a barrier or without, seeing what the draws before it wrote; else it reads the copy, before a
|
||||
//! barrier the texels from before the pass, the M3 Max's answer: a private texture's reader
|
||||
//! through small scissors reads that, a surface's reads the x86 Macs'.
|
||||
//! - **After a memory barrier.** A barrier over the render targets orders the draws after it
|
||||
//! behind those before it, which a Mac2 GPU runs (Apple GPUs do not support that scope, the
|
||||
//! Metal Feature Set Tables: `fence.rs`). Inside an instance it orders one pixel alone
|
||||
|
||||
+28
-18
@@ -5024,25 +5024,35 @@ each item named states the rule in full.
|
||||
that reads the clear before any draw of the pass reads its copy cleared to the clear in the
|
||||
pass's first instance, where the copy can be so (`WorkCounts::attachment_read_clears`), else
|
||||
an instance after one of the clear alone. With no
|
||||
barrier a draw that writes the color it reads reads the texels from before the pass at its own
|
||||
pixel, the M3 Max's answer; one that writes nothing of it, below. The
|
||||
barrier a draw reads at its own pixel what the draws before it wrote where the runtime takes no
|
||||
copy for it, else the texels from before the pass, the M3 Max's answer (below). The
|
||||
conformance cases `pass-start-barrier-*` keep the M3 Max's texels and take the Mac2 answer as
|
||||
the one other.
|
||||
- **A draw that reads its own pass's color attachment at its own pixels, and writes nothing of
|
||||
that color, reads what the draws before it wrote, with no barrier too.** Metal defines no answer
|
||||
here, and the Macs disagree. On an M3 Max (macOS 27.0.1) such a draw read the texels from before
|
||||
the pass at every pixel, in a pass that clears too. On an AMD Radeon Pro 5300M and an Intel UHD
|
||||
Graphics 630 (macOS 26.7.1) it read the earlier draw's texels at 98.6% and 99.99% of the pixels,
|
||||
and at all of them after a barrier over the render targets; the rest read the load's or the
|
||||
clear's texels. The runtime answers as the x86 Macs, which costs no copy: where the device
|
||||
enabled `attachmentFeedbackLoopLayout` and its passes fetch no color as an input attachment (it
|
||||
has `fragmentShaderPixelInterlock` and not `rasterizationOrderColorAttachmentAccess`), a draw
|
||||
whose fragment function reads the texture at the fragment's own pixel alone, and that writes no
|
||||
channel of the color, reads the attachment itself, behind a barrier inside the pass, and sees
|
||||
the load and every earlier draw of the pass (`WorkCounts::reading_draws_in_place`, the runtime's
|
||||
`render/snapshot.rs`). A draw that writes the color it reads still reads a copy taken before the
|
||||
pass, the M3 Max's answer, and so does every such draw on any other device (lavapipe, which has
|
||||
rasterization-order access, and a device without the interlock, such as the Radeon RX 550).
|
||||
the one other, and their rows that read at their own pixels with no barrier the clear (below).
|
||||
- **A draw that reads its own pass's color attachment at its own pixels reads what the draws
|
||||
before it wrote, with no barrier too, where the runtime takes no copy for it.** Metal defines no
|
||||
answer here, and the Macs disagree. On an M3 Max (macOS 27.0.1) such a draw read the texels from
|
||||
before the pass at every pixel, in a pass that clears too. On an AMD Radeon Pro 5300M and an
|
||||
Intel UHD Graphics 630 (macOS 26.7.1) it read the earlier draw's texels at 98.6% and 99.99% of
|
||||
the pixels, and at all of them after a barrier over the render targets; the rest read the load's
|
||||
or the clear's texels. The runtime gives the x86 Macs' answer where that costs no copy, and the
|
||||
M3 Max's where the copy is the cheaper form, so a reader can see either, each one a Mac's:
|
||||
- where the device enabled `attachmentFeedbackLoopLayout` and its passes fetch no color as an
|
||||
input attachment (it has `fragmentShaderPixelInterlock` and not
|
||||
`rasterizationOrderColorAttachmentAccess`), a draw whose fragment function reads the texture
|
||||
at the fragment's own pixel alone, and that writes no channel of the color, reads the
|
||||
attachment itself, behind a barrier inside the pass, and sees the load and every earlier draw
|
||||
of the pass (`WorkCounts::reading_draws_in_place`);
|
||||
- a draw that writes the color it reads reads it through a snapshot where the device takes the
|
||||
snapshot route (section "Snapshot reads") and the snapshot costs no more than the copy, and
|
||||
sees the same: always for a color that renders a texture over a buffer's bytes, as a
|
||||
surface's does, and for a private texture by the area rule, which takes the snapshot through
|
||||
large scissors alone (`WorkCounts::reading_draws_snapshotted`). On a Radeon 780M a
|
||||
compositor's frame of six such readers over surfaces took 3.41 ms of GPU time against 4.07
|
||||
with the copies;
|
||||
- every other such draw reads a copy taken before the pass, the M3 Max's answer: a private
|
||||
texture's reader through small scissors, and every reader on lavapipe (which has
|
||||
rasterization-order access) or on a device without the interlock, such as the Radeon RX 550
|
||||
(the runtime's `render/snapshot.rs`, `texture/attached_reads.rs`).
|
||||
|
||||
**GPU hangs and faults** (a draw of private primitive type 9, `DrawPrimitiveType::Nine`)
|
||||
|
||||
|
||||
+9
-3
@@ -288,9 +288,15 @@ recorded here.
|
||||
earlier draws wrote, the x86 Macs' answer, where the M3 Max reads the texels from before the pass
|
||||
(an AMD Radeon Pro 5300M and an Intel UHD Graphics 630 read the earlier draw's texels at 98.6%
|
||||
and 99.99% of the pixels and at all of them after a barrier, the M3 Max at none: docs/API.md's
|
||||
accepted differences). A draw that writes the color it reads keeps the copy where the device has
|
||||
the feedback loop too: read in place, it would race its own writes of the attachment, a data
|
||||
race Vulkan forbids; none where every read
|
||||
accepted differences). A draw that writes the color it reads would race its own writes of the
|
||||
attachment read in place, a data race Vulkan forbids: with no barrier too, it reads through a
|
||||
snapshot where the device takes the snapshot route and the snapshot costs no more than the
|
||||
copy (over a buffer's bytes, a surface's, always; a private texture by the area rule), seeing
|
||||
the same as in place (on a Radeon 780M a compositor's six such readers over surfaces took 3.41 ms
|
||||
of GPU time a frame against 4.07 with the copies, `runtime_lane::attachment_read_costs`'s
|
||||
`backdrop_costs`), and else keeps the copy, the M3 Max's answer: a private texture's reader
|
||||
through small scissors answers the M3 Max's texels, a surface's the x86 Macs'. No copy where
|
||||
every read
|
||||
of the slot reaches only levels before the lowest one the instance renders, which it reads in
|
||||
the texture's own image through a view of those levels (`render/attached_levels.rs`,
|
||||
`WorkCounts::attached_read_slots_narrowed`), or only levels past the highest one, through a view
|
||||
|
||||
Reference in new issue
Block a user