From 87994746eafade7bcc733c5f8ba12c19282390a9 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 26 Oct 2026 20:43:21 +0200 Subject: [PATCH] Take IdPlacement::Outside for a texture over the caller's VkImage One work packet, landed as 2 commits (6e5d7acfc7..6c8a857d8b on archive/development-linear-2026-10-28), in order: * Take IdPlacement::Outside for a texture over the caller's VkImage `Device::new_texture_with_vk_image` now accepts `IdPlacement::Outside`, the runtime extension `Device::new_texture` already takes for a caller's helper texture: the placement check is skipped for Outside, and `Texture::made` (already handed `IdUse::Program(placement)`) takes no ID and holds no slot. The wrapped path otherwise behaves as before; it still takes no device sampler ID at any placement. Why: the consumer wraps its swapchain images with this call. Refused at Outside, it had to give them `Any`, so they took texture resource IDs and a guest's textures' `gpuResourceID` and `uniqueIdentifier` started past them while a window was open: the guest's answers depended on whether a window existed. At Outside the program's textures are numbered as with no window. Docs: `IdPlacement::Outside`, the resource-ID module docs, `check_texture_placement`, `Problem::OutsidePlacement`, `TextureDescriptor::placement`, the call's own doc (which now says it is a runtime extension and how it places the texture), docs/API.md and the runtime README. docs/REFUSALS.md regenerated (the OutsidePlacement row's wording). No public signature moved (`signatures.py --check` passes). RUNTIME_VERSION 1647: a call that was refused now makes a texture, which the version's rule ("a refusal or its class") counts as a behaviour change. runtime-sources.sha256 follows the edited runtime files. Test: `presenting::a_callers_image_placed_outside_takes_no_id` (device lane). After a reservation of 20000, a plain texture takes 20001 on a device with no caller's texture; a caller's texture placed Any takes 20001 itself and moves the plain texture to 20002; one placed Outside answers 0 and the plain texture takes 20001. Placed Outside before the reservation it starts no space (the plain texture still takes 20001), and a clear of it is what a blit copy of it reads. Verified, on this Mac (Apple M3 Max, MoltenVK, --cfg m2v_gpu, under the shared GPU lock): the new test passes and prints "the plain texture after a reservation of 20000 answers 20001 with no caller's texture; (Some(20001), 20002) after one placed Any; (Some(0), 20001) after one placed Outside". With the old unconditional placement check put back it fails: new_texture_with_vk_image returns Invalid(OutsidePlacement). Also passing in the same run: every presenting test, resource_ids::an_outside_texture_takes_no_id, and the runtime-sources guard. clippy -D warnings for metal2vulkan-runtime (all targets, all features) plain, and for metal2vulkan-runtime and metal2vulkan-validation under --cfg m2v_gpu; runtime rustdoc with -D warnings; the refusal_surface, api_surface and api_signatures tests. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. --- crates/metal2vulkan-runtime/README.md | 3 +- crates/metal2vulkan-runtime/src/error.rs | 6 +- .../metal2vulkan-runtime/src/resource_ids.rs | 27 ++-- .../src/texture/wrapped.rs | 23 ++- .../src/texture_descriptor.rs | 3 +- .../runtime-sources.sha256 | 2 +- .../src/runtime_lane/presenting.rs | 146 +++++++++++++++++- crates/metal2vulkan/src/cache/mod.rs | 2 +- docs/API.md | 4 +- docs/REFUSALS.md | 2 +- 10 files changed, 188 insertions(+), 30 deletions(-) diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index 69e8a83dc..8feaabbb9 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -176,7 +176,8 @@ the runtime made. - `CommandBuffer::encode_wait_for_vk_semaphore` and `encode_signal_vk_semaphore` order a command buffer against the consumer's own work. - `Device::new_texture_with_vk_image` makes a `Private` texture over the consumer's `VkImage` (a - swapchain image, for presenting). + swapchain image, for presenting). Placed `IdPlacement::Outside`, it takes no resource ID, so the + program's textures are numbered as with no window. - `Device::new_buffer_with_vk_buffer` makes a buffer over the consumer's `VkBuffer` and memory, such as an imported dma-buf, made with `Device::vk_buffer_usage()`. The runtime never frees it. diff --git a/crates/metal2vulkan-runtime/src/error.rs b/crates/metal2vulkan-runtime/src/error.rs index 3235fefcc..f21c0eab8 100644 --- a/crates/metal2vulkan-runtime/src/error.rs +++ b/crates/metal2vulkan-runtime/src/error.rs @@ -812,9 +812,9 @@ pub enum Problem { limit: u64, }, /// [`IdPlacement::Outside`](crate::IdPlacement::Outside) for anything but a texture - /// `Device::new_texture` makes: a sampler state, a pipeline state, an indirect command - /// buffer, a view, or a heap's, a buffer's, a shared or a caller's texture. A runtime - /// extension's misuse: Metal has no such placement. + /// `Device::new_texture` or `Device::new_texture_with_vk_image` makes: a sampler state, a + /// pipeline state, an indirect command buffer, a view, or a heap's, a buffer's or a shared + /// texture. A runtime extension's misuse: Metal has no such placement. /// /// Basis: ours (a runtime extension's misuse: Metal has no such placement). OutsidePlacement, diff --git a/crates/metal2vulkan-runtime/src/resource_ids.rs b/crates/metal2vulkan-runtime/src/resource_ids.rs index 88e52eef6..5f98060b7 100644 --- a/crates/metal2vulkan-runtime/src/resource_ids.rs +++ b/crates/metal2vulkan-runtime/src/resource_ids.rs @@ -86,9 +86,11 @@ //! reserved, a defect the runtime does not copy: it places that state too. An indirect command //! buffer is placed by its descriptor's `placement` (Metal's `resourceIndex`, unforced), keeping //! the index's low 32 bits, as the same rules say (`address.rs`). A texture -//! [`Device::new_texture`](super::Device::new_texture) makes [`Outside`](IdPlacement::Outside) -//! takes no ID, as the runtime's own textures: a runtime extension for a caller's helper texture, -//! refused for every other resource. +//! [`Device::new_texture`](super::Device::new_texture) or +//! [`Device::new_texture_with_vk_image`](super::Device::new_texture_with_vk_image) makes +//! [`Outside`](IdPlacement::Outside) takes no ID, as the runtime's own textures: a runtime +//! extension for a caller's helper texture or its swapchain image, refused for every other +//! resource. //! - **Reservations** ([`Device::reserve_resource_ids`](super::Device::reserve_resource_ids), //! textures, sampler states, pipeline states and indirect command buffers, Metal's types 0, 1, //! 4 and 5) keep IDs from plain allocation for good, whether a resource placed at one lives or @@ -188,15 +190,17 @@ pub enum IdPlacement { Any, /// This ID, which the resource's `gpu_resource_id` then answers. At(ResourceId), - /// No ID, for a texture [`Device::new_texture`](super::Device::new_texture) makes: its + /// No ID, for a texture [`Device::new_texture`](super::Device::new_texture) or + /// [`Device::new_texture_with_vk_image`](super::Device::new_texture_with_vk_image) makes: its /// `gpu_resource_id` answers 0, the null handle, it holds no slot (no ID a function reads /// reaches it), and it counts in no plain allocation or reservation and starts no space, as - /// the runtime's own textures. It is otherwise made as with [`Any`](IdPlacement::Any), the - /// device's sampler ID included, so no Metal resource's ID depends on it: for a caller's - /// helper texture that stands behind a Metal one. Its views take their own IDs at their own - /// placements. A runtime extension, the counterpart of `AddressPlacement::Outside`: Metal has - /// no such placement. Refused (`Invalid`, `Problem::OutsidePlacement`) for every other - /// resource that takes its placement. + /// the runtime's own textures. It is otherwise made as with [`Any`](IdPlacement::Any) (by + /// `new_texture`, the device's sampler ID included), so no Metal resource's ID depends on it: + /// for a caller's helper texture that stands behind a Metal one, or a texture over the + /// caller's swapchain image, so a program's textures take the IDs they take with no window. + /// Its views take their own IDs at their own placements. A runtime extension, the counterpart + /// of `AddressPlacement::Outside`: Metal has no such placement. Refused (`Invalid`, + /// `Problem::OutsidePlacement`) for every other resource that takes its placement. Outside, } @@ -1204,7 +1208,8 @@ impl Device { /// Refuse `placement` of a texture of `usage` and `texture_type` as the module docs say, for /// `call`: past the limit, or past a set-1 array the texture can be bound through (sampled /// where its usage reads, storage where it writes; a texture buffer through none); and - /// [`IdPlacement::Outside`], which only `new_texture` takes and does not check here. + /// [`IdPlacement::Outside`], which only `new_texture` and `new_texture_with_vk_image` take, + /// neither checking it here. pub(super) fn check_texture_placement( &self, call: &'static str, diff --git a/crates/metal2vulkan-runtime/src/texture/wrapped.rs b/crates/metal2vulkan-runtime/src/texture/wrapped.rs index 07f999b60..6391d63b6 100644 --- a/crates/metal2vulkan-runtime/src/texture/wrapped.rs +++ b/crates/metal2vulkan-runtime/src/texture/wrapped.rs @@ -33,6 +33,7 @@ use super::super::image_barrier::{image_barrier, ImageDst}; use super::super::image_plan::{plan_image, ImagePlan}; use super::super::key_hash::KeyMap; use super::super::resource::{Identity, ResourceKey}; +use super::super::resource_ids::IdPlacement; use super::super::sharing::Sharing; use super::super::texture_descriptor::{texture_usage, TextureDescriptor}; use super::super::tracker::{Access, Use, UseRange}; @@ -505,6 +506,13 @@ impl Device { /// input attachment usage may be missing: a pass that fetches the texture renders into a /// stand-in that has it. /// + /// A runtime extension: Metal makes no texture over a Vulkan image. The descriptor's + /// `placement` gives the texture's resource ID as `new_texture`'s does + /// (`resource_ids.rs`), and [`IdPlacement::Outside`](crate::IdPlacement::Outside) gives it + /// none, as there: it answers 0, holds no slot, and counts in no plain allocation or + /// reservation, so a swapchain image moves no program texture's ID. Unlike `new_texture`, + /// the call takes no sampler ID for the device at any placement. + /// /// Refused: a descriptor Metal stops, as [`Device::new_texture`] refuses it; storage other /// than `Private` (`Invalid`, `StorageMode`); an image that contradicts the descriptor (a /// usage missing, [`WrappedImageProblem::Usage`]), a layout outside the contract, or a texture @@ -535,12 +543,15 @@ impl Device { ) -> Result { const CALL: &str = "new_texture_with_vk_image"; let descriptor = &self.texture_options(CALL, descriptor)?; - self.check_texture_placement( - CALL, - descriptor.placement, - descriptor.usage, - descriptor.texture_type, - )?; + // An `Outside` texture takes no ID, so no ID's limit applies. + if descriptor.placement != IdPlacement::Outside { + self.check_texture_placement( + CALL, + descriptor.placement, + descriptor.usage, + descriptor.texture_type, + )?; + } let wrapped = |problem| invalid(CALL, Problem::WrappedImage(problem)); let options = descriptor.resource_options; let storage = options.storage_mode()?; diff --git a/crates/metal2vulkan-runtime/src/texture_descriptor.rs b/crates/metal2vulkan-runtime/src/texture_descriptor.rs index e82153273..6148e38fd 100644 --- a/crates/metal2vulkan-runtime/src/texture_descriptor.rs +++ b/crates/metal2vulkan-runtime/src/texture_descriptor.rs @@ -210,7 +210,8 @@ pub struct TextureDescriptor { /// `resourceIndex` with `forceResourceIndex` (Apple's private properties, a runtime /// extension): where the texture goes in the space of texture resource IDs /// (`resource_ids.rs`). [`IdPlacement::Outside`], no ID at all, is - /// [`Device::new_texture`](crate::Device::new_texture)'s alone. + /// [`Device::new_texture`](crate::Device::new_texture)'s and + /// [`Device::new_texture_with_vk_image`](crate::Device::new_texture_with_vk_image)'s alone. pub placement: IdPlacement, /// `framebufferOnly` (`setFramebufferOnly:`, SPI): the texture is meant for render passes /// alone. Plain Metal makes such a texture over an IOSurface plane only diff --git a/crates/metal2vulkan-validation/runtime-sources.sha256 b/crates/metal2vulkan-validation/runtime-sources.sha256 index 10b50db75..0a71cfd3c 100644 --- a/crates/metal2vulkan-validation/runtime-sources.sha256 +++ b/crates/metal2vulkan-validation/runtime-sources.sha256 @@ -1 +1 @@ -0a79238a17c72f89c526af4d7595bee46f4010f8c9ad6d158a7c5235c45a097c +37eb83710d95b68233293bcece1299329472e4166a534951387a97c821dc81a8 diff --git a/crates/metal2vulkan-validation/src/runtime_lane/presenting.rs b/crates/metal2vulkan-validation/src/runtime_lane/presenting.rs index ceaaf1375..23d627de0 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/presenting.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/presenting.rs @@ -1,6 +1,7 @@ //! Device tests of step 10 on the device the cfg selects: presenting a texture the runtime rendered //! through a swapchain the test makes on a device it adopts, the caller's images around the -//! runtime's batches, binary semaphores both ways, shared texture handles, and each refusal typed. +//! runtime's batches, binary semaphores both ways, shared texture handles, the resource ID a +//! texture over the caller's image takes, and each refusal typed. //! //! Two tests make their own instance and device, as a consumer that adopts its device does //! ([`Adopted`]): the validation layer, a debug-utils messenger that collects what the layer @@ -23,9 +24,9 @@ use metal2vulkan::device::{DevicePolicy, EnableSet, VkExtension}; use metal2vulkan::metal::{PixelFormat, TextureUsage}; use metal2vulkan_runtime::{ BlitOption, Buffer, ClearColor, CommandBuffer, Device, Error, HazardTrackingMode, IdPlacement, - Invalid, LoadAction, Nil, Origin, Problem, RawDevice, ResourceOptions, SemaphoreProblem, - ShaderCacheOptions, Size, StorageMode, StoreAction, Texture, TextureDescriptor, VkImageLayouts, - WrappedImageProblem, + Invalid, LoadAction, Nil, Origin, Problem, RawDevice, ResourceId, ResourceIdKind, + ResourceOptions, SemaphoreProblem, ShaderCacheOptions, Size, StorageMode, StoreAction, Texture, + TextureDescriptor, VkImageLayouts, WrappedImageProblem, }; use std::collections::BTreeSet; use std::ffi::{c_void, CStr, CString}; @@ -1163,6 +1164,143 @@ fn wrapped_images_order_across_queues() { layer_reported_nothing_at_all(&messages); } +/// A texture over an image the test makes through `Device::raw` (`UNDEFINED` at first, `GENERAL` +/// between the runtime's batches), of [`target`]'s `RGBA8Unorm` descriptor placed `placement`, +/// with the image and its memory, which [`destroy_callers`] destroys once nothing uses them. +fn callers_texture( + device: &Device, + placement: IdPlacement, +) -> (Texture, vk::Image, vk::DeviceMemory) { + // SAFETY: used only while the device lives. + let raw = unsafe { device.raw() }; + // SAFETY: a physical device of the instance. + let memory = unsafe { + raw.instance + .get_physical_device_memory_properties(raw.physical_device) + }; + let usage = vk::ImageUsageFlags::COLOR_ATTACHMENT + | vk::ImageUsageFlags::TRANSFER_SRC + | vk::ImageUsageFlags::TRANSFER_DST; + let info = shared_among( + image_info(vk::Format::R8G8B8A8_UNORM, usage), + raw.queue_families, + ); + // SAFETY: the device is live; `destroy_callers` destroys them after their last use. + let (image, bound) = unsafe { made_image(raw.device, &memory, &info) }; + let mut descriptor = target(PixelFormat::RGBA8Unorm); + descriptor.placement = placement; + // SAFETY: a live image of the device, made with `info`, bound, in `UNDEFINED` now; it + // outlives the texture and every command buffer that uses it, and nothing else uses it. + let texture = unsafe { + device.new_texture_with_vk_image( + &descriptor, + image, + &info, + VkImageLayouts::new( + vk::ImageLayout::UNDEFINED.into(), + vk::ImageLayout::GENERAL.into(), + ), + ) + } + .unwrap(); + (texture, image, bound) +} + +/// Destroy `image` and its memory `bound`, which [`callers_texture`] made on `device`. +/// +/// # Safety +/// +/// Nothing uses them: their texture is gone and every command buffer that used it completed and +/// is gone. +unsafe fn destroy_callers(device: &Device, image: vk::Image, bound: vk::DeviceMemory) { + // SAFETY: used only while the device lives; the caller's contract. + unsafe { + let raw = device.raw(); + raw.device.destroy_image(image, None); + raw.device.free_memory(bound, None); + } +} + +/// A texture over the caller's image placed [`IdPlacement::Outside`] takes no resource ID, as a +/// texture `new_texture` makes there does (`resource_ids::an_outside_texture_takes_no_id`), so a +/// consumer's swapchain textures move no program texture's ID. After a reservation of 20000 it +/// answers 0, and the plain texture made next takes 20001, the ID it takes on a device with no +/// caller's texture; one placed `Any` takes 20001 itself and moves the plain texture to 20002. +/// It starts no space: a reservation after it counts. It renders and copies as one placed `Any` +/// does: what a clear of it wrote is what a copy of it reads. +#[test] +fn a_callers_image_placed_outside_takes_no_id() { + let cache = ScratchCache::new().unwrap(); + let messages = Messages::default(); + let plain = TextureDescriptor::texture_2d(PixelFormat::RGBA16Float, 4, 4, false); + let reserve = |device: &Device| { + device + .reserve_resource_ids(ResourceIdKind::Texture, &[ResourceId(20000)]) + .unwrap() + }; + // On a new device: the reservation, a texture over the caller's image at `placement` where + // there is one, and a plain texture; the IDs they answer. + let ids = |placement: Option| -> (Option, u64) { + let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap(); + reserve(&device); + let callers = placement.map(|placement| callers_texture(&device, placement)); + let next = device.new_texture(&plain).unwrap(); + let answered = ( + callers + .as_ref() + .map(|(texture, ..)| texture.gpu_resource_id().0), + next.gpu_resource_id().0, + ); + if let Some((texture, image, bound)) = callers { + drop(texture); + // SAFETY: the texture is gone and no command buffer used it. + unsafe { destroy_callers(&device, image, bound) }; + } + answered + }; + let without = ids(None); + let any = ids(Some(IdPlacement::Any)); + let outside = ids(Some(IdPlacement::Outside)); + eprintln!( + "runtime ids: the plain texture after a reservation of 20000 answers {} with no \ + caller's texture; {:?} after one placed Any; {:?} after one placed Outside", + without.1, any, outside + ); + assert_eq!(without, (None, 20001)); + assert_eq!(any, (Some(20001), 20002), "a caller's texture placed Any"); + assert_eq!( + outside, + (Some(0), 20001), + "a caller's texture placed Outside" + ); + { + let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap(); + let (texture, image, bound) = callers_texture(&device, IdPlacement::Outside); + reserve(&device); + let next = device.new_texture(&plain).unwrap(); + assert_eq!( + [texture.gpu_resource_id().0, next.gpu_resource_id().0], + [0, 20001], + "a reservation after a caller's texture placed Outside" + ); + let queue = device.new_command_queue().unwrap(); + let size = u64::from(SIDE * SIDE * 4); + let readback = device.new_buffer(size, ResourceOptions::shared()).unwrap(); + let command_buffer = queue.command_buffer().unwrap(); + clear(&command_buffer, &texture, [0.0, 1.0, 0.0, 1.0]); + copy_out(&command_buffer, &texture, &readback); + run(&command_buffer); + assert_eq!( + read_buffer(&readback, 0, size).unwrap(), + filled([0, 255, 0, 255]) + ); + drop((texture, command_buffer, queue)); + // SAFETY: the texture is gone, and the command buffer that used it completed and is gone. + unsafe { destroy_callers(&device, image, bound) }; + } + layer_reported_nothing_at_all(&messages); +} + fn invalid(call: &'static str, problem: Problem) -> Error { Error::Invalid(Invalid::new(call, problem)) } diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index 290fc1d2e..b93e19533 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -93,7 +93,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 451; /// changes no behaviour, and then updates that hash alone with the commit saying why, or changes /// behaviour and also bumps this version. The commit that bumps it says what changed; this comment /// keeps no history. -pub const RUNTIME_VERSION: u32 = 1644; +pub const RUNTIME_VERSION: u32 = 1647; /// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex, /// of the manifest, the build script, and exactly the files the crate roots' module tree compiles diff --git a/docs/API.md b/docs/API.md index cfc2faca5..64ce99fe4 100644 --- a/docs/API.md +++ b/docs/API.md @@ -3272,7 +3272,9 @@ each item named states the rule in full. - **The device counts the sampler IDs it holds** (`Device::sampler_ids_live`, `Device::sampler_id_pool_size`), runtime extensions for a consumer that models Metal's sampler heap. -- **A texture can take no resource ID** (`IdPlacement::Outside`), for a consumer's helper textures. +- **A texture can take no resource ID** (`IdPlacement::Outside`), for a consumer's helper textures + and its textures over its own images (`Device::new_texture_with_vk_image`), such as swapchain + images. - **An indirect command buffer placed at an ID** (`IndirectCommandBufferDescriptor::placement`, Apple's private `setResourceIndex:`) takes it as Metal does; an index of 16384 or more is refused. - **A pipeline state placed before any pipeline ID is made** (`PipelineOptions::placement`) is made, diff --git a/docs/REFUSALS.md b/docs/REFUSALS.md index 9c887614a..48de96834 100644 --- a/docs/REFUSALS.md +++ b/docs/REFUSALS.md @@ -363,7 +363,7 @@ Columns: | `Heap` | A heap, or a resource placed in one, Metal stops (`new_heap` and the heap's calls) | every device (a public call's own check of its arguments) | `delegated`: HeapProblem, section 9 | 13: `crates/metal2vulkan-runtime/src/buffer_descriptor.rs (buffer_over_host_memory)`, `crates/metal2vulkan-runtime/src/buffer_descriptor.rs (rebind_host_pages)` (+11) | `-` | | `ResourceId` | A resource ID, placed or reserved, of `limit` or more | every device (a public call's own check of its arguments) | `metal-measured`: an M4 and an M3 Max, macOS 27.0.1: the IDs at which Metal ends the process, recorded in `resource_ids.rs` | 1: `crates/metal2vulkan-runtime/src/resource_ids.rs (check_limit)` | `-` | | `ReservationHangs` | An indirect command buffer ID of `limit` (2^31) to 2^32 - 1 in a reservation (`Device::reserve_resource_ids`) | every device (a public call's own check of its arguments) | `metal-measured`: an M3 Max, macOS 27.0.1: Metal's call never returns, its pool spinning | 1: `crates/metal2vulkan-runtime/src/resource_ids.rs (reserve_resource_ids)` | `-` | -| `OutsidePlacement` | [`IdPlacement::Outside`](crate::IdPlacement::Outside) for anything but a texture `Device::new_texture` makes | every device (a public call's own check of its arguments) | `ours`: a runtime extension's misuse: Metal has no such placement | 4: `crates/metal2vulkan-runtime/src/resource_ids.rs (check_sampler_placement)`, `crates/metal2vulkan-runtime/src/resource_ids.rs (check_texture_placement)` (+2) | `-` | +| `OutsidePlacement` | [`IdPlacement::Outside`](crate::IdPlacement::Outside) for anything but a texture `Device::new_texture` or `Device::new_texture_with_vk_image` makes | every device (a public call's own check of its arguments) | `ours`: a runtime extension's misuse: Metal has no such placement | 4: `crates/metal2vulkan-runtime/src/resource_ids.rs (check_sampler_placement)`, `crates/metal2vulkan-runtime/src/resource_ids.rs (check_texture_placement)` (+2) | `-` | | `FunctionTable` | A visible-function table call, or a table or buffer binding a dispatch reads as the other, Metal stops | every device (a public call's own check of its arguments) | `delegated`: FunctionTableProblem, section 9 | 3: `crates/metal2vulkan-runtime/src/argument_table.rs (check_function_tables)`, `crates/metal2vulkan-runtime/src/function_table.rs (not_one_stage)` (+1) | `-` | | `IndirectCommandBuffer` | An indirect command buffer call plain Metal itself refuses, ending its process or failing the call | every device (a public call's own check of its arguments) | `delegated`: IndirectCommandBufferProblem, section 9 | 1: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs (problem)` | `-` | | `RateMap` | A rasterization-rate map's descriptor Metal stops (`new_rasterization_rate_map`) | every device (a public call's own check of its arguments) | `delegated`: RateMapProblem, section 9 | 6: `crates/metal2vulkan-runtime/src/rate_map.rs (map_physical_to_screen_coordinates, 2 sites)`, `crates/metal2vulkan-runtime/src/rate_map.rs (map_screen_to_physical_coordinates, 2 sites)` (+2) | `-` |