rt: copies between a heap texture and memory it aliases are Metal's own refusal, but a whole level between two heap textures
Row L212. Metal's API validation stops a copy between aliases in a placement heap unless it copies between buffers, between linear textures of one row stride, or entire texture surfaces. Source: probe overlapping_alias_copies.m on an Apple M3 Max, macOS 27.0.1, jobs m3-max-81486 and m3-max-81493. The runtime refused all of these as Gap::OverlappingCopy. It now refuses what Metal stops as Refusal::AliasingCopy, and records nothing for it. Form (blit.rs): - buffer_copy: a region that meets a heap texture's memory, either way, is Refusal::AliasingCopy (Metal: "blitting between aliasing resources is defined on a placement heap only when using a blit method copying entire texture surfaces, or when copying between buffers"). - texture_copy: two textures whose memory meets, one placed in a heap, that are not both heap textures copying a whole level into a whole level (whole_level: origin 0, size the level's extent, the view's first level taken off) are Refusal::AliasingCopy. A texture in place over a heap buffer against a heap texture is refused even for a whole level (Metal: "... only when both textures are linear and have the same bufferBytesPerRow value"). - The whole level between two heap textures stays Gap::OverlappingCopy, counted, per the planner's ruling. That is how the consumer reaches copyFromTexture:toTexture:, which Metal's validation takes and the M3 answers with the source's bytes at 0, 128 and 8320 bytes apart. No copy command and no cut reads no byte it writes (VUID-vkCmdCopyImage-pRegions-00124). The form through an image of the runtime's, counted, is built once a guest's run counts the gap. Docs: blit.rs's module and copy method docs; error.rs's Gap::OverlappingCopy (REFUSALS.md regenerated); Metrics::overlapping_copies_refused; the runtime README's blit encoders and their known gaps, which carry the M3's answer and the VUID. The README also cites the M3's answer for a surface's buffer and its own plane (job m3-max-81486). No conformance ledger row covers these shapes. Verified: refusal_surface.py --check exits 0. Green under the validation layer, which fails a test on any message: the three tests pass, with the rest of the 27 blit tests, at the series' tip on lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M (RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671). The runs built the series before its rebase onto development; the patches are the same.
This commit is contained in:
1 parent
19d642612d
commit
2416a42d36
5 files changed
+95
-35
No files matched your search
@@ -3328,11 +3328,19 @@ while the driver's exit handler waited on a lock, with every runtime thread alre
|
||||
two. Where one destination row lies on a source row before its own and another on one after
|
||||
its own (rows of two pitches that cross), no such order is taken, and the copy is
|
||||
`Gap::OverlappingCopy` (below).
|
||||
- Two textures whose memory meets where one is placed in a heap (`Device::new_heap_texture`),
|
||||
which Metal leaves undefined as it does any aliased heap resources' contents: the device lays
|
||||
that texture's texels out as it chooses, so no copy command is known to read no byte it writes,
|
||||
and the copy is `Gap::OverlappingCopy`. Two slices or levels of one heap texture are one
|
||||
image's, and copy as any texture's.
|
||||
- Two textures whose memory meets where one is placed in a heap (`Device::new_heap_texture`) are
|
||||
aliases. Metal's validation layer takes a copy between aliases in a placement heap only of
|
||||
entire texture surfaces (`copyFromTexture:toTexture:`, which the consumer copies as whole
|
||||
levels), or between two linear textures of one row stride, which are the textures in place
|
||||
above. So a copy between two heap textures that is not a whole level into a whole level, and
|
||||
any copy between a heap texture and a texture in place over a buffer, is refused
|
||||
(`Refusal::AliasingCopy`), as Metal's validation stops it: "blitting between aliasing resources
|
||||
is defined on a placement heap only when using a blit method copying entire texture surfaces,
|
||||
or when copying between buffers", and "... only when both textures are linear and have the same
|
||||
bufferBytesPerRow value" (an Apple M3 Max, macOS 27.0.1, probe `overlapping_alias_copies.m` in
|
||||
the conformance crate, jobs m3-max-81486 and m3-max-81493). A whole level into a whole level
|
||||
between two heap textures is `Gap::OverlappingCopy` (below). Two slices or levels of one heap
|
||||
texture are one image's, and copy as any texture's.
|
||||
- `copy_from_buffer` is `copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:`
|
||||
`sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:` and
|
||||
`copy_from_texture_to_buffer` is `copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:`
|
||||
@@ -3366,11 +3374,17 @@ while the driver's exit handler waited on a lock, with every runtime thread alre
|
||||
execution barrier between two slabs. The region on the texture's own texels copies nothing.
|
||||
Where the rows meet in no order a cut along one axis keeps, they go one at a time, as between
|
||||
two textures over one buffer. An exported surface's buffer (`Surface::buffer`) and its own
|
||||
plane in place are a buffer and a texture in place over it so. Where rows of two pitches cross,
|
||||
and where the region's bytes meet the memory of a texture placed in a heap, the copy is
|
||||
`Gap::OverlappingCopy` (below). Metal
|
||||
leaves such a copy undefined; the answer between a buffer and its texture was not recorded on
|
||||
a Mac, and is the one an Apple M3 Max gives between two textures over one buffer.
|
||||
plane in place are a buffer and a texture in place over it so: an Apple M3 Max gives the
|
||||
source's bytes from before the copy between an IOSurface's no-copy buffer and its own plane's
|
||||
texture, a row on each way and 8 texels along, into the plane and out of it, its validation
|
||||
layer passing each (probe `overlapping_alias_copies.m`, job m3-max-81486). Where rows of two
|
||||
pitches cross, the copy is `Gap::OverlappingCopy` (below). Where the region's bytes meet the
|
||||
memory of a texture placed in a heap, the two are aliases in a placement heap, and the copy is
|
||||
refused (`Refusal::AliasingCopy`), as Metal's validation stops it, in the words quoted for two
|
||||
textures above (job m3-max-81486); with the layer off an Apple M3 Max gives the source's bytes.
|
||||
Metal leaves a copy between a buffer and a texture over its bytes undefined; the answer between
|
||||
a buffer and its texture was not recorded on a Mac, and is the one an Apple M3 Max gives
|
||||
between two textures over one buffer.
|
||||
- Refused (`Refusal::BufferCopyLayout`), as Metal's validation stops them: an offset or row stride
|
||||
of no whole number of a format's texels, rows or images closer than the region's, and a region
|
||||
past the buffer's end. Metal reads no row stride of a region one row high and no image stride of a
|
||||
@@ -3437,10 +3451,14 @@ while the driver's exit handler waited on a lock, with every runtime thread alre
|
||||
time from one end order are refused: rows of two pitches that cross, one destination row on a
|
||||
source row before its own and another on one after its own. An order of rows from where they
|
||||
cross is built when a replay stream or a walk counts one.
|
||||
- A copy between a texture placed in a heap and a texture or a buffer whose memory meets its
|
||||
range is refused alike (`Gap::OverlappingCopy`): the device lays the heap texture's texels out
|
||||
as it chooses, and Metal leaves the contents of aliased heap resources undefined, so nothing is
|
||||
emulated.
|
||||
- A copy of a whole level into a whole level between two textures placed in a heap whose memory
|
||||
meets is refused alike (`Gap::OverlappingCopy`). Metal's validation takes it as a copy of entire
|
||||
texture surfaces, and an Apple M3 Max gives the source's bytes from before the copy with the
|
||||
two textures 0, 128 and 8320 bytes apart (jobs m3-max-81486 and m3-max-81493). No direct form
|
||||
exists: the two images' memory overlaps and the device lays each one's texels out as it
|
||||
chooses, so no copy command, nor any cut of the copy into several, is known to read no byte it
|
||||
writes (`VUID-vkCmdCopyImage-pRegions-00124`). The form through an image of the runtime's,
|
||||
copied in and then out, counted, is built once a guest's run counts this gap.
|
||||
- Measured on R8Unorm at 1920 x 1080 on a Radeon 780M under RADV (Mesa 26.2.6): a copy from a
|
||||
buffer into part of a one-sample colour texture (`copy_from_buffer`; `replace_region` of part
|
||||
of a texture records the same copy, not measured) can leave one aligned 4 x 2 cell of the
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
//! Regions whose bytes meet, of one level and slice or of two textures in place over one buffer,
|
||||
//! are the one exception to one command: slabs along one axis, or rows one at a time each cut
|
||||
//! across, one `vkCmdCopyImage` each, an execution barrier between two ([`Slabs`]). Memory a
|
||||
//! texture placed in a heap shares with the other side is in no order a copy command keeps
|
||||
//! texture placed in a heap shares with the other side is an alias of it, which Metal's
|
||||
//! validation copies between only for entire texture surfaces (`Refusal::AliasingCopy`), and a
|
||||
//! whole level into a whole level between two heap textures is in no order a copy command keeps
|
||||
//! (`Gap::OverlappingCopy`).
|
||||
//!
|
||||
//! A copy between a buffer and a texture is the same: `vkCmdCopyBufferToImage` or
|
||||
@@ -198,9 +200,12 @@ impl BlitCommandEncoder {
|
||||
/// [`Refusal::TextureCopyMismatch`]; [`Gap::TextureCopy`]; [`Gap::OverlappingCopy`], counted,
|
||||
/// for regions of two textures over one buffer whose rows meet where neither a cut along one
|
||||
/// axis nor rows one at a time order them (one destination row on a source row before its own
|
||||
/// and another on one after its own), and for two textures whose memory meets where one is
|
||||
/// placed in a heap
|
||||
/// ([`Device::new_heap_texture`](crate::Device::new_heap_texture)); with a texture buffer,
|
||||
/// and another on one after its own), and for a whole level into a whole level between two
|
||||
/// textures placed in a heap
|
||||
/// ([`Device::new_heap_texture`](crate::Device::new_heap_texture)) whose memory meets, which
|
||||
/// Metal's validation takes as a copy of entire texture surfaces; [`Refusal::AliasingCopy`]
|
||||
/// for any other copy between two textures whose memory meets where one is placed in a heap,
|
||||
/// which Metal's validation stops; with a texture buffer,
|
||||
/// what those calls refuse ([`Refusal::BufferCopyOverlap`] for regions whose bytes meet);
|
||||
/// [`Error::Vulkan`] where the command buffer cannot record.
|
||||
pub fn copy_from_texture(
|
||||
@@ -466,7 +471,9 @@ impl BlitCommandEncoder {
|
||||
/// stops; [`Gap::BufferCopyAlignment`] for one no copy command in the floor addresses;
|
||||
/// [`Gap::TextureBytes`]; [`Gap::OverlappingCopy`], counted, for rows of a texture in place
|
||||
/// that meet the region's where neither a cut along one axis nor rows one at a time order
|
||||
/// them, and for a texture placed in a heap whose memory meets the region's bytes;
|
||||
/// them; [`Refusal::AliasingCopy`] for a texture placed in a heap whose memory meets the
|
||||
/// region's bytes, as Metal's validation stops a copy between a buffer and a texture that
|
||||
/// alias in a placement heap;
|
||||
/// [`Refusal::BufferCopyOverlap`] for a texture buffer whose bytes meet the region's;
|
||||
/// [`Error::Vulkan`] where the command buffer cannot record.
|
||||
pub fn copy_from_buffer(
|
||||
@@ -1787,7 +1794,7 @@ impl BufferCopy {
|
||||
/// and a row stride of whole blocks ([`Gap::BufferCopyAlignment`]).
|
||||
///
|
||||
/// Err: [`Gap::TextureBytes`]; [`Refusal::TextureRegion`];
|
||||
/// [`Refusal::BufferCopyLayout`]; [`Gap::BufferCopyAlignment`].
|
||||
/// [`Refusal::BufferCopyLayout`]; [`Gap::BufferCopyAlignment`]; [`Refusal::AliasingCopy`].
|
||||
pub(crate) fn buffer_copy(
|
||||
texture: &Side<'_>,
|
||||
at: TexturePlace,
|
||||
@@ -1892,8 +1899,10 @@ pub(crate) fn buffer_copy(
|
||||
// with it. No command's source and destination share a byte
|
||||
// (`VUID-vkCmdCopyBufferToImage-pRegions-00173`, `VUID-vkCmdCopyImageToBuffer-pRegions-00184`):
|
||||
// rows of a texture in place cut into slabs as two textures over one buffer do (`meeting`),
|
||||
// the region's rows `bytes_per_row` apart; bytes of an image the device lays out as it
|
||||
// chooses, none.
|
||||
// the region's rows `bytes_per_row` apart. Bytes of a texture placed in a heap, whose texels
|
||||
// the device lays out as it chooses, are an alias of the region's, and Metal's validation
|
||||
// stops a copy between a buffer and a texture that alias in a placement heap (probe
|
||||
// `overlapping_alias_copies.m` in the conformance crate, job m3-max-81486).
|
||||
let region = Span {
|
||||
buffer,
|
||||
base: start,
|
||||
@@ -1919,7 +1928,9 @@ pub(crate) fn buffer_copy(
|
||||
)
|
||||
.or_else(|| row_by_row(from, to, placed.size, bytes))
|
||||
}
|
||||
(_, Some(bound)) if bound.meets(region) => None,
|
||||
(_, Some(bound)) if bound.meets(region) => {
|
||||
return Err(Error::Refused(Refusal::AliasingCopy { pixel_format }));
|
||||
}
|
||||
_ => cut(None, [1; 3], placed.size),
|
||||
};
|
||||
let slabs = match slabs {
|
||||
@@ -1940,7 +1951,8 @@ pub(crate) fn buffer_copy(
|
||||
/// they are one texture. `None` where it copies nothing; slabs of `None` where the two regions'
|
||||
/// bytes meet in no order a copy command keeps.
|
||||
///
|
||||
/// Err: [`Refusal::TextureCopyMismatch`]; [`Gap::TextureCopy`]; [`Refusal::TextureRegion`].
|
||||
/// Err: [`Refusal::TextureCopyMismatch`]; [`Gap::TextureCopy`]; [`Refusal::TextureRegion`];
|
||||
/// [`Refusal::AliasingCopy`].
|
||||
pub(crate) fn texture_copy(
|
||||
source: &Side<'_>,
|
||||
from: TexturePlace,
|
||||
@@ -2052,8 +2064,22 @@ pub(crate) fn texture_copy(
|
||||
.or_else(|| row_by_row(a, b, from.size, texel))
|
||||
}
|
||||
// Memory one of them shares with the other where the device lays its texels out as it
|
||||
// chooses (a texture placed in a heap): no order.
|
||||
// chooses (a texture placed in a heap), which the two then alias. Metal's validation takes
|
||||
// a copy between aliases in a placement heap only between buffers, between linear
|
||||
// textures of one row stride (rows in place, above), or of entire texture surfaces
|
||||
// (probe `overlapping_alias_copies.m` in the conformance crate, jobs m3-max-81486 and
|
||||
// m3-max-81493): anything else is refused as Metal refuses it. A whole level into a whole
|
||||
// level between two heap textures, which is how `copyFromTexture:toTexture:` reaches the
|
||||
// runtime: no order.
|
||||
_ if !same && (source.bound.zip(destination.bound)).is_some_and(|(a, b)| a.meets(b)) => {
|
||||
let surface = |side: &Side<'_>, placed: &Placed| {
|
||||
side.rows.is_none() && whole_level(side.descriptor, side.base[0], placed)
|
||||
};
|
||||
if !(surface(source, &from) && surface(destination, &to)) {
|
||||
return Err(Error::Refused(Refusal::AliasingCopy {
|
||||
pixel_format: formats.0,
|
||||
}));
|
||||
}
|
||||
None
|
||||
}
|
||||
_ => cut(None, [1; 3], from.size),
|
||||
@@ -2148,6 +2174,14 @@ fn row_by_row(from: Rows, to: Rows, size: [u32; 3], texel: u64) -> Option<Option
|
||||
(!(lower && higher) && !thin).then_some(Some(Slabs::Rows(rows)))
|
||||
}
|
||||
|
||||
/// Whether `placed` is the whole of its level of a texture of `d` that starts at level `base` of
|
||||
/// its image (a view's first level): what Metal's copies of entire texture surfaces copy.
|
||||
fn whole_level(d: &TextureDescriptor, base: u32, placed: &Placed) -> bool {
|
||||
let level = placed.level - base;
|
||||
let extent = [d.width, d.height, d.depth].map(|e| (e >> level).max(1));
|
||||
placed.origin == [0; 3] && placed.size == extent
|
||||
}
|
||||
|
||||
/// Of a texture whose texels of `texel` bytes lie in `rows`, where the first texel of `placed`
|
||||
/// lies.
|
||||
fn first(rows: Rows, placed: &Placed, texel: u64) -> Rows {
|
||||
|
||||
@@ -3511,8 +3511,8 @@ pub struct Metrics {
|
||||
/// command orders as from the source before the copy
|
||||
/// ([`Gap::OverlappingCopy`](crate::Gap::OverlappingCopy)): rows of a texture in place over
|
||||
/// a buffer that meet the other side's shifted both ways, or not shifted, along each axis,
|
||||
/// and a texture placed in a heap whose memory meets the other side's. Copies the guest
|
||||
/// asked for that did not run.
|
||||
/// and a whole level into a whole level between two textures placed in a heap whose memory
|
||||
/// meets. Copies the guest asked for that did not run.
|
||||
pub overlapping_copies_refused: u64,
|
||||
/// Heap textures' images moved from undefined to their home layout before a command that
|
||||
/// writes them (a dispatch's slot or declared write, a pass's attachment, a draw's write, a
|
||||
|
||||
@@ -1455,14 +1455,21 @@ pub enum Gap {
|
||||
/// in place and its buffer, that meet the other side's rows so that neither a cut into slabs along one axis
|
||||
/// nor the rows one at a time keep the order: rows of two pitches where one destination row
|
||||
/// lies on a source row before its own and another on a source row after its own; or a
|
||||
/// texture placed in a heap ([`Device::new_heap_texture`](crate::Device::new_heap_texture)),
|
||||
/// whose texels the device lays out as it chooses, whose memory meets the other side's.
|
||||
/// Counted in
|
||||
/// whole level into a whole level between two textures placed in a heap
|
||||
/// ([`Device::new_heap_texture`](crate::Device::new_heap_texture)), whose texels the device
|
||||
/// lays out as it chooses, whose memory meets. Metal's validation takes that copy as one of
|
||||
/// entire texture surfaces (`copyFromTexture:toTexture:`, which the consumer copies as whole
|
||||
/// levels), and an Apple M3 Max gives the source's bytes from before the copy with the two
|
||||
/// 0, 128 and 8320 bytes apart (probe `overlapping_alias_copies.m` in the conformance crate,
|
||||
/// jobs m3-max-81486 and m3-max-81493); any other copy between a heap texture and memory it
|
||||
/// aliases is [`Refusal::AliasingCopy`]. Counted in
|
||||
/// [`Metrics::overlapping_copies_refused`](crate::Metrics::overlapping_copies_refused).
|
||||
///
|
||||
/// Basis: ours (no copy command reads bytes it writes, `VUID-vkCmdCopyImage-pRegions-00124`
|
||||
/// and its twins; rows of two pitches that cross are built, in an order of rows from where
|
||||
/// they cross, when a replay stream or a walk counts one).
|
||||
/// and its twins, and the device's layout of two heap textures leaves no cut; rows of two
|
||||
/// pitches that cross are built, in an order of rows from where they cross, when a replay
|
||||
/// stream or a walk counts one; the whole level between two heap textures is built through
|
||||
/// an image of the runtime's, counted, when a guest's run counts one).
|
||||
OverlappingCopy {
|
||||
/// The textures' pixel format.
|
||||
pixel_format: PixelFormat,
|
||||
|
||||
+4
-3
@@ -31,7 +31,7 @@ Columns:
|
||||
| Rate maps the compile layer does not compile | 5 | 5 | 0 | 0 | 4 | 1 | 0 |
|
||||
| The translation deadline | 1 | 1 | 0 | 0 | 0 | 1 | 0 |
|
||||
| Devices below the runtime's floor | 8 | 8 | 0 | 0 | 0 | 0 | 0 |
|
||||
| The runtime's `Refusal` | 95 | 94 | 0 | 0 | 0 | 0 | 0 |
|
||||
| The runtime's `Refusal` | 95 | 95 | 0 | 0 | 0 | 0 | 0 |
|
||||
| The runtime's `Limit` | 21 | 21 | 0 | 0 | 0 | 0 | 0 |
|
||||
| The runtime's `Gap` | 31 | 31 | 0 | 0 | 0 | 0 | 0 |
|
||||
|
||||
@@ -287,7 +287,7 @@ Columns:
|
||||
| `TextureViewFormat` | `Texture::new_texture_view` of a pixel format Metal does not view the texture as | every device (a public call's own check of its arguments) | `metal-measured`: an Apple M3 Max, macOS 27.0.1, probe `texture_view_rules.m` in the conformance crate, jobs m3-max-43677 and m3-max-59523: Metal's validation layer stops a view of another format of a texture of `ShaderRead` usage, `R32Uint`, `RGBA8Uint`, `BGRA8Unorm` and `BGRA8Unorm_sRGB` of `RGBA8Unorm`, `A8Unorm`, `R8Snorm` and `R8Uint` of `R8Unorm`, `R16Unorm` of `RG8Unorm`, "texture usage (0x01) doesn't specify MTLTextureUsagePixelFormatView (0x10)", and makes it where the usage adds `PixelFormatView`; plain Metal makes each, a blit out of it reading the texture's bytes; Apple's `makeTextureView` and `MTLTextureUsage.pixelFormatView` pages state the rest | 2: `crates/metal2vulkan-runtime/src/d3d11.rs (d3d11_plane_form)`, `crates/metal2vulkan-runtime/src/texture.rs (view)` | `-` |
|
||||
| `MipmapFormat` | `BlitCommandEncoder::generate_mipmaps` of a texture of more than one level whose pixel format is not a colour-renderable, filterable one | every device (a public call's own check of its arguments) | `metal-measured`: Apple's `generateMipmaps(for:)` page: mipmap generation works only for textures with colour-renderable and colour-filterable pixel formats; Metal's API validation stops the others, measured on an Apple M3 Max and an M4 | 1: `crates/metal2vulkan-runtime/src/blit.rs (generate_mipmaps)` | `-` |
|
||||
| `TextureCopyMismatch` | `BlitCommandEncoder::copy_from_texture` between textures of two pixel formats, or of two sample counts | every device (a public call's own check of its arguments) | `metal-measured`: an Apple M3 Max, macOS 27.0.1, probe `blit_copy_format_pairs.m` in the conformance crate: Metal's validation layer stops every pair of two formats it was given, sRGB, integer, float, channel order, depth and compressed pairs among them, with `[sourceTexture pixelFormat](...) must equal [destinationTexture pixelFormat](...)`, and a source of four samples into one of one with `[sourceTexture sampleCount](4) must equal [destinationTexture sampleCount](1)` | 2: `crates/metal2vulkan-runtime/src/blit.rs (texel_texture_copy)`, `crates/metal2vulkan-runtime/src/blit.rs (texture_copy)` | `-` |
|
||||
| `AliasingCopy` | A blit copy between a texture placed in a heap (`Device::new_heap_texture`) and a resource whose memory meets the texture's, which the two then... | every device (a public call's own check of its arguments) | `metal-measured`: an Apple M3 Max, macOS 27.0.1, probe `overlapping_alias_copies.m` in the conformance crate, jobs m3-max-81486 and m3-max-81493: Metal's validation layer stops a copy between a buffer and a texture over its bytes in a placement heap, either way, and the region method between two textures over each other's bytes, over part of a level or all of it, with "blitting between aliasing resources is defined on a placement heap only when using a blit method copying entire texture surfaces, or when copying between buffers", and `copyFromTexture:toTexture:` between a heap texture and a linear texture over a heap buffer at its bytes with "blitting between aliasing resources is defined on a placement heap only when both textures are linear and have the same bufferBytesPerRow value"; with the layer off, each gives the source's bytes from before the copy | 0 | `-` |
|
||||
| `AliasingCopy` | A blit copy between a texture placed in a heap (`Device::new_heap_texture`) and a resource whose memory meets the texture's, which the two then... | every device (a public call's own check of its arguments) | `metal-measured`: an Apple M3 Max, macOS 27.0.1, probe `overlapping_alias_copies.m` in the conformance crate, jobs m3-max-81486 and m3-max-81493: Metal's validation layer stops a copy between a buffer and a texture over its bytes in a placement heap, either way, and the region method between two textures over each other's bytes, over part of a level or all of it, with "blitting between aliasing resources is defined on a placement heap only when using a blit method copying entire texture surfaces, or when copying between buffers", and `copyFromTexture:toTexture:` between a heap texture and a linear texture over a heap buffer at its bytes with "blitting between aliasing resources is defined on a placement heap only when both textures are linear and have the same bufferBytesPerRow value"; with the layer off, each gives the source's bytes from before the copy | 2: `crates/metal2vulkan-runtime/src/blit.rs (buffer_copy)`, `crates/metal2vulkan-runtime/src/blit.rs (texture_copy)` | `-` |
|
||||
| `ManagedTextureBytes` | A Managed texture's bytes the device cannot copy in place (`Device::new_managed_texture`) | every device (a public call's own check of its arguments) | `ours`: a buffer-to-image copy reads a place only so laid out, and the consumer's bytes are the place the copy reads | 5: `crates/metal2vulkan-runtime/src/texture.rs (check_places)`, `crates/metal2vulkan-runtime/src/texture.rs (named)` (+2) | `-` |
|
||||
| `BufferTextureLayout` | A texture over a buffer (`Buffer::new_texture`) whose rows are not a whole number of texels apart or are closer than a row, whose offset is not a... | every device (a public call's own check of its arguments) | `ours`: a linear image and a copy read rows whole texels apart from a texel's start, and texels past the buffer would lie in memory it does not hold | 2: `crates/metal2vulkan-runtime/src/texture.rs (check_over)`, `crates/metal2vulkan-runtime/src/texture.rs (texel_texture)` | `-` |
|
||||
| `TextureNotInPlace` | A texture over a buffer asked of `Buffer::new_texture_in_place` that `Buffer::new_texture` would make as the counted copy, an image of its own... | every device (a public call's own check of its arguments) | `ours`: the call makes a texture in place or none, so that the consumer keeps the bytes in a texture of its own where the device's linear image does not take them | 2: `crates/metal2vulkan-runtime/src/texture.rs (texture, 2 sites)` | `-` |
|
||||
@@ -368,7 +368,7 @@ Columns:
|
||||
| `CubicSampler` | A sampler state whose minification or magnification filter is cubic (`Device::new_sampler_state`) | every device (a public call's own check of its arguments) | `ours`: the translator's identity domains do not filter bicubically, and Vulkan's cubic filter is not Metal's | 1: `crates/metal2vulkan-runtime/src/sampler.rs (new_sampler_state)` | `-` |
|
||||
| `TextureBytes` | `Texture::replace_region`, `Texture::get_bytes` or a blit copy between a buffer and a texture (`BlitCommandEncoder::copy_from_buffer`) of a... | every device (a public call's own check of its arguments) | `ours`: no copy between such an image and bytes is built | 4: `crates/metal2vulkan-runtime/src/blit.rs (buffer_copy)`, `crates/metal2vulkan-runtime/src/blit.rs (with_option)` (+2) | `-` |
|
||||
| `TextureCopy` | `BlitCommandEncoder::copy_from_texture` that the floor's `vkCmdCopyImage` does not make | every device (a public call's own check of its arguments) | `ours`: Vulkan 1.3 copies none of these with one command; each is built when a replay stream makes one | 1: `crates/metal2vulkan-runtime/src/blit.rs (texture_copy)` | `-` |
|
||||
| `OverlappingCopy` | A blit copy whose source and destination share memory where no copy command orders it as from the source before the copy, which Metal leaves... | every device (a public call's own check of its arguments) | `ours`: no copy command reads bytes it writes, `VUID-vkCmdCopyImage-pRegions-00124` and its twins; rows of two pitches that cross are built, in an order of rows from where they cross, when a replay stream or a walk counts one | 2: `crates/metal2vulkan-runtime/src/blit.rs (buffer_copy)`, `crates/metal2vulkan-runtime/src/blit.rs (copy_from_texture)` | `-` |
|
||||
| `OverlappingCopy` | A blit copy whose source and destination share memory where no copy command orders it as from the source before the copy, which Metal leaves... | every device (a public call's own check of its arguments) | `ours`: no copy command reads bytes it writes, `VUID-vkCmdCopyImage-pRegions-00124` and its twins, and the device's layout of two heap textures leaves no cut; rows of two pitches that cross are built, in an order of rows from where they cross, when a replay stream or a walk counts one; the whole level between two heap textures is built through an image of the runtime's, counted, when a guest's run counts one | 2: `crates/metal2vulkan-runtime/src/blit.rs (buffer_copy)`, `crates/metal2vulkan-runtime/src/blit.rs (copy_from_texture)` | `-` |
|
||||
| `TextureOverBuffer` | A texture over a buffer (`Buffer::new_texture`) the runtime does not make | every device (a public call's own check of its arguments) | `ours`: the in-place linear image and the copy form take one 2D color image, and a texture buffer's view the texel-buffer offset alignment of Vulkan 1.3 | 4: `crates/metal2vulkan-runtime/src/texture.rs (check_over)`, `crates/metal2vulkan-runtime/src/texture.rs (error)` (+2) | `-` |
|
||||
| `HeapTexture` | A heap texture the runtime does not place (`Device::new_heap_texture`, `Device::new_heap_texture_for_views` and `Device::heap_texture_size_and_align`) | every device (a public call's own check of its arguments) | `ours`: heap textures are built for Private and Shared heaps of placeable images | 2: `crates/metal2vulkan-runtime/src/texture.rs (heap_fit)`, `crates/metal2vulkan-runtime/src/texture.rs (heap_source)` | `-` |
|
||||
| `SurfaceUsage` | A plane of a Direct3D 11 texture's import (`Device::import_d3d11_surface`, on Windows) whose texture's uses ask an image usage the texture's bind... | at the device's limit | `device`: the import's image format query and the texture's bind flags | 2: `crates/metal2vulkan-runtime/src/d3d11.rs (d3d11_plane_form)`, `crates/metal2vulkan-runtime/src/texture.rs (surface_texture)` | `-` |
|
||||
@@ -594,6 +594,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `rt:Refusal::TextureViewFormat`: `crates/metal2vulkan-runtime/src/d3d11.rs (d3d11_plane_form)`; `crates/metal2vulkan-runtime/src/texture.rs (view)`
|
||||
- `rt:Refusal::MipmapFormat`: `crates/metal2vulkan-runtime/src/blit.rs (generate_mipmaps)`
|
||||
- `rt:Refusal::TextureCopyMismatch`: `crates/metal2vulkan-runtime/src/blit.rs (texel_texture_copy)`; `crates/metal2vulkan-runtime/src/blit.rs (texture_copy)`
|
||||
- `rt:Refusal::AliasingCopy`: `crates/metal2vulkan-runtime/src/blit.rs (buffer_copy)`; `crates/metal2vulkan-runtime/src/blit.rs (texture_copy)`
|
||||
- `rt:Refusal::ManagedTextureBytes`: `crates/metal2vulkan-runtime/src/texture.rs (check_places)`; `crates/metal2vulkan-runtime/src/texture.rs (named)`; `crates/metal2vulkan-runtime/src/texture.rs (named_host)`; `crates/metal2vulkan-runtime/src/texture.rs (upload_region, 2 sites)`
|
||||
- `rt:Refusal::BufferTextureLayout`: `crates/metal2vulkan-runtime/src/texture.rs (check_over)`; `crates/metal2vulkan-runtime/src/texture.rs (texel_texture)`
|
||||
- `rt:Refusal::TextureNotInPlace`: `crates/metal2vulkan-runtime/src/texture.rs (texture, 2 sites)`
|
||||
|
||||
Reference in new issue
Block a user