diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index f7bc4b6c2..10c3b9fa2 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -1055,14 +1055,16 @@ created with external memory handle types listed in the external image implied l accessed outside of Vulkan, they must be in the layout specified in the table, and can be assumed to be in that layout when they are accessed in Vulkan after external access", and the table's row for `VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT` is `VK_IMAGE_LAYOUT_GENERAL`. A plane's -image is made in the undefined layout, and no upload moves it. Each `vkQueueSubmit2` whose command -buffers or uploads use a plane acquires it from `VK_QUEUE_FAMILY_EXTERNAL` in a command buffer of -rt's own ahead of everything in it, and releases it to that family in another after everything in -it, both to the general layout: one barrier each, counted in `Metrics::external_acquires` and -`Metrics::external_releases`. A plane's first acquire names the undefined layout as its old layout -where the consumer reported no Direct3D 11 access of it before (`Surface::external_writes_done`), -and the general layout where it did; every later acquire, and every release, names the general -layout. The acquire +image is made in the undefined layout, and no upload moves it: section 12.10.1 says the image "is +not usable until it acquires ownership of its memory from the existing owner. Therefore, the layout +specified as part of this transition will be the true initial layout of the image. The undefined +layout specified when creating it is a placeholder to simplify valid usage requirements." +Direct3D 11 made the memory, so every acquire, the first included, names the general layout as its +old layout, and what Direct3D 11 wrote is kept whatever order the consumer's calls arrive in. Each +`vkQueueSubmit2` whose command buffers or uploads use a plane acquires it from +`VK_QUEUE_FAMILY_EXTERNAL` in a command buffer of rt's own ahead of everything in it, and releases +it to that family in another after everything in it, both from and to the general layout: one +barrier each, counted in `Metrics::external_acquires` and `Metrics::external_releases`. The acquire follows a global barrier from and to every stage, so an earlier submission's release on rt's one queue happens before it (Vulkan 1.4, section 7.7.6). The call counts in `Metrics::d3d11_plane_submissions` and the two command buffers in @@ -1073,22 +1075,15 @@ command buffers rt sends member by member, one `vkQueueSubmit2` a member, each s progress value, hands each member's planes over in that member's call, so a member ahead of the last is seen complete after its own planes' release and not before it; each such call counts in `Metrics::d3d11_plane_parts` too. Direct3D 11 thus owns the planes' memory between rt's -submissions. `Surface::external_writes_done()` records nothing and makes no GPU work for such a -surface: it marks each plane accessed by Direct3D 11, on the host, so each acquire from then on -names the general layout. `BlitCommandEncoder::release_surface_to_external(&surface)` records -nothing. So the consumer's precondition is that Direct3D 11's work that accesses a plane has -completed before the consumer commits the command buffers that use it, that the consumer calls -`Surface::external_writes_done()` after each such access and before that commit, and that rt's -command buffers that use a plane have completed before Direct3D 11 accesses it again. Without the -call after Direct3D 11's first access, rt's first acquire of the plane names the undefined layout, -which does not preserve the contents (Vulkan 1.4, section 12.5.1: "implying that the contents of -the image subresource need not be preserved"), so the device may discard what Direct3D 11 wrote. -No keyed mutex is used, by rt or on the textures: each is made with +submissions. `Surface::external_writes_done()` and +`BlitCommandEncoder::release_surface_to_external(&surface)` record nothing and change nothing for +such a surface. So the consumer's precondition is that Direct3D 11's work that accesses a plane has +completed before the consumer commits the command buffers that use it, and that rt's command +buffers that use a plane have completed before Direct3D 11 accesses it again. No keyed mutex is used, by rt or on the textures: each is made with `D3D11_RESOURCE_MISC_SHARED | D3D11_RESOURCE_MISC_SHARED_NTHANDLE`, not `D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX`, whose mutex the device that makes the texture and each device that opens it must acquire before rendering to it; the consumer orders the two APIs' work -by its waits. A plane rt uses before any Direct3D 11 access has undefined contents, as a Metal -texture nothing wrote does. The surface has no buffer: `Surface::buffer()` is +by its waits. A plane nothing wrote has undefined contents, as a Metal texture nothing wrote does. The surface has no buffer: `Surface::buffer()` is `Gap::D3d11SurfaceBuffer`, as its planes lie in memories of their own, and `Surface::handle()` is `None`. No upload's move goes ahead of the planes' first use, so `Surface::wait_until_ready()` returns at once. The planes' imports are freed as an exported surface's memory is (above); rt keeps diff --git a/crates/metal2vulkan-runtime/src/d3d11.rs b/crates/metal2vulkan-runtime/src/d3d11.rs index 7e47079c9..81ef4ce71 100644 --- a/crates/metal2vulkan-runtime/src/d3d11.rs +++ b/crates/metal2vulkan-runtime/src/d3d11.rs @@ -2,12 +2,12 @@ //! host's: the planes another API decodes or draws into, shared by their NT handles, each //! imported as an optimal image of its own and read by rt's shaders in place. //! -//! The import makes no submission and waits for nothing. A plane's image is made undefined, and -//! Vulkan takes it as general once Direct3D 11 has accessed it (section 12.5.2, below), which the -//! consumer reports by `Surface::external_writes_done`: no upload moves it, and its first acquire -//! names the undefined layout where no such access was reported before it. Each `vkQueueSubmit2` -//! that uses a plane takes it from `VK_QUEUE_FAMILY_EXTERNAL` at its start and gives it back at -//! its end, before its signals (`crate::submit::parts`). +//! The import makes no submission and waits for nothing. A plane's image is made undefined, a +//! placeholder: Direct3D 11 made the memory, and Vulkan implies the general layout for it outside +//! Vulkan (section 12.5.2, below), so no upload moves it and every acquire, the first included, +//! takes it from the general layout. Each `vkQueueSubmit2` that uses a plane takes it from +//! `VK_QUEUE_FAMILY_EXTERNAL` at its start and gives it back at its end, before its signals +//! (`crate::submit::parts`). use crate::counters::Gauge; use crate::device::{Core, Device}; @@ -116,21 +116,22 @@ impl Device { /// the layout specified in the table, and can be assumed to be in that layout when they are /// accessed in Vulkan after external access", and its Table 17 gives /// `VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT` the layout `VK_IMAGE_LAYOUT_GENERAL`. - /// So a plane's first acquire names the undefined layout as its old layout where the - /// consumer reported no Direct3D 11 access of it before - /// ([`Surface::external_writes_done`]), and the general layout where it did; every later - /// acquire names the general layout, the plane being general after rt's own first acquire - /// and release. "First" is the first acquire rt records for the plane. The Khronos validation - /// layer does not track this import's layout: on the UHD 630 its 1.4.363.0 reported neither - /// a first acquire from the general layout nor one from the undefined layout, so its silence - /// is no evidence of either. + /// Section 12.10.1 (External Resource Sharing) says of an image bound to memory another + /// API owns: "Such an image is not usable until it acquires ownership of its memory from the + /// existing owner. Therefore, the layout specified as part of this transition will be the + /// true initial layout of the image. The undefined layout specified when creating it is a + /// placeholder to simplify valid usage requirements." Direct3D 11 made the texture, so it is + /// that owner, and every acquire of a plane, the first included, names the general layout + /// as its old layout, whether or not the consumer called [`Surface::external_writes_done`] + /// before the commit: a move from the undefined layout would not preserve what Direct3D 11 + /// wrote (section 12.5.1). The Khronos validation layer does not track this import's layout: + /// on the UHD 630 its 1.4.363.0 reported neither a first acquire from the general layout nor + /// one from the undefined layout, so its silence is no evidence of either. /// /// **Ownership.** Each `vkQueueSubmit2` whose command buffers or uploads use a plane acquires /// it from `VK_QUEUE_FAMILY_EXTERNAL` in a command buffer of rt's own ahead of everything in - /// it, from the general layout, or from the undefined layout at its first acquire as - /// **Layout** says (`VUID-VkImageMemoryBarrier-srcQueueFamilyIndex-12332` allows either), to - /// the general layout, and releases it to that family in another after everything in it, in - /// the general layout + /// it, from and to the general layout (`VUID-VkImageMemoryBarrier-srcQueueFamilyIndex-12332`), + /// and releases it to that family in another after everything in it, in the general layout /// (`...-dstQueueFamilyIndex-12331`), which takes that call's last signals, its progress value /// among them, so it adds no submit info and a command buffer that uses a plane is seen /// complete only once the plane's release has run: Direct3D 11 owns the planes' memory @@ -143,22 +144,17 @@ impl Device { /// queue happens before it (Vulkan 1.4, section 7.7.6). /// [`Surface::external_writes_done`] and /// [`release_surface_to_external`](crate::BlitCommandEncoder::release_surface_to_external) - /// record nothing for such a surface; the first marks its planes accessed by Direct3D 11, on - /// the host (**Layout**). No keyed mutex is used, by rt or on the textures: each - /// is made with `D3D11_RESOURCE_MISC_SHARED | D3D11_RESOURCE_MISC_SHARED_NTHANDLE`, not + /// record nothing for such a surface and change nothing. No keyed mutex is used, by rt or on + /// the textures: each is made with + /// `D3D11_RESOURCE_MISC_SHARED | D3D11_RESOURCE_MISC_SHARED_NTHANDLE`, not /// `D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX`, whose mutex the device that makes the texture and /// each device that opens it must acquire before rendering to it; the consumer orders the two /// APIs' work by its waits. /// /// **The consumer's precondition.** Direct3D 11's work that accesses a plane has completed - /// before the consumer commits the command buffers that use it, the consumer calls - /// [`Surface::external_writes_done`] after each such access and before that commit, and rt's - /// command buffers that use a plane have completed before Direct3D 11 accesses it again. - /// Without the call after Direct3D 11's first access, rt's first acquire of the plane names - /// the undefined layout, and a transition from it does not preserve the contents (section - /// 12.5.1: "implying that the contents of the image subresource need not be preserved"), so - /// the device may discard what Direct3D 11 wrote. A plane rt uses before any Direct3D 11 - /// access has undefined contents, as a Metal texture nothing wrote does. + /// before the consumer commits the command buffers that use it, and rt's command buffers that + /// use a plane have completed before Direct3D 11 accesses it again. A plane nothing wrote has + /// undefined contents, as a Metal texture nothing wrote does. /// /// The surface has no buffer: [`Surface::buffer`] is [`Gap::D3d11SurfaceBuffer`], as its /// planes lie in memories of their own. @@ -365,9 +361,9 @@ impl Device { .tiling(vk::ImageTiling::OPTIMAL) .usage(usage) .sharing_mode(vk::SharingMode::EXCLUSIVE) - // An external image is made undefined (`VUID-VkImageCreateInfo-pNext-01443`), which - // its first acquire names where no Direct3D 11 access was reported; after one, it is - // in the general layout (section 12.5.2, `Image::handed`). + // An external image is made undefined (`VUID-VkImageCreateInfo-pNext-01443`), a + // placeholder: each acquire takes it from the general layout, Direct3D 11's + // (sections 12.5.2 and 12.10.1, `Image::handed`). .initial_layout(vk::ImageLayout::UNDEFINED) .push_next(&mut external); if !list.is_empty() { diff --git a/crates/metal2vulkan-runtime/src/surface.rs b/crates/metal2vulkan-runtime/src/surface.rs index 3bfecb266..da774a892 100644 --- a/crates/metal2vulkan-runtime/src/surface.rs +++ b/crates/metal2vulkan-runtime/src/surface.rs @@ -1649,15 +1649,10 @@ impl Surface { /// [`Metrics::external_acquires`](crate::Metrics::external_acquires). In the copy form it is /// the block's acquire, and the submissions copy the bytes into the planes' images. The /// contract is the block's. For a Direct3D 11 import (`Device::import_d3d11_surface`, on - /// Windows) the call records nothing and makes no GPU work: each `vkQueueSubmit2` that uses - /// its planes acquires them itself - /// ([`Metrics::d3d11_plane_submissions`](crate::Metrics::d3d11_plane_submissions)), and the - /// call marks each plane accessed by Direct3D 11, on the host, so each acquire from then on - /// names the general layout, which Vulkan takes such a plane to be in after external access - /// (section 12.5.2). The consumer calls it after every Direct3D 11 access, before committing - /// the command buffers that use the planes: without it, a plane's first acquire names the - /// undefined layout it is made in, which may discard what Direct3D 11 wrote (section - /// 12.5.1). + /// Windows) the call records nothing and changes nothing: each `vkQueueSubmit2` that uses + /// its planes acquires them itself, from the general layout, the first acquire included + /// ([`Metrics::d3d11_plane_submissions`](crate::Metrics::d3d11_plane_submissions)), so what + /// Direct3D 11 wrote is kept whether the call comes before or after the commit. /// /// Err: [`Refusal::InScheduledHandler`] in a scheduled handler; [`Error::Quiesced`]; and /// [`Error::Vulkan`] where the upload's command buffer cannot be made. @@ -1665,12 +1660,8 @@ impl Surface { if let Kind::Copy(block, _) = &self.kind { return block.external_writes_done(); } - // Each `vkQueueSubmit2` that uses a Direct3D 11 import's planes acquires them itself; the - // call marks them accessed, so each acquire from now on names the general layout. + // Each `vkQueueSubmit2` that uses a Direct3D 11 import's planes acquires them itself. if self.handle.is_none() { - for texture in &self.planes { - texture.held_image().external_access(); - } return Ok(()); } crate::command::not_in_scheduled_handler()?; diff --git a/crates/metal2vulkan-runtime/src/tests/d3d11.rs b/crates/metal2vulkan-runtime/src/tests/d3d11.rs index 5973946ee..7083de5b2 100644 --- a/crates/metal2vulkan-runtime/src/tests/d3d11.rs +++ b/crates/metal2vulkan-runtime/src/tests/d3d11.rs @@ -16,7 +16,9 @@ //! Two reads committed back to back on queues of their own, the first not waited for before the //! second commits, read picture 1 exactly and count two plane-keeping submissions, two acquires //! and two releases; on an instance without the validation layer, 64 reads committed back to back -//! on one queue are timed, per command buffer, and printed. +//! on one queue are timed, per command buffer, and printed. A picture Direct3D 11 drew before rt's +//! first commit is read exactly with `external_writes_done` after that commit, and every acquire +//! of a plane, the first included, names the general layout, with or without the call before it. //! While the surface lives, the surface imports gauge holds its two planes; it has no buffer and //! no export handle. Each plane's image takes the usage its texture's bind flags give and no //! other: made rendered and sampled, no storage; made sampled alone, not rendered; and a texture @@ -759,21 +761,21 @@ mod on_device { }); } - /// The old layout of each plane's acquire. A plane is made undefined - /// (`VUID-VkImageCreateInfo-pNext-01443`) and is general only after Direct3D 11's access - /// (section 12.5.2), which the consumer reports by `Surface::external_writes_done`. On a - /// surface rt writes first, with no such call (a blit of picture 3 into both planes), - /// each plane's first acquire names the undefined layout, and the acquire of rt's next - /// read names the general layout; Direct3D 11 reads picture 3 exactly between them, and - /// that read is picture 3's exactly. On a surface Direct3D 11 draws first, reported by - /// `external_writes_done`, every acquire names the general layout, the first included, - /// and rt reads picture 1 exactly. The acquires are read from the record the hand-over - /// keeps for the device tests (`Work::acquired`). The Khronos validation layer does not - /// track this import's layout, so it is no check here: on the UHD 630 its 1.4.363.0 - /// reported neither the old form's first acquire from the general layout (job - /// m3-max-76170) nor this form's from the undefined layout (job m3-max-76174). + /// The old layout of each plane's acquire: the general layout, the first included, + /// whether or not `Surface::external_writes_done` came before it. A plane is made + /// undefined, a placeholder for the layout of memory Direct3D 11 made, which Vulkan takes + /// as general (sections 12.5.2 and 12.10.1). On a surface rt writes first, with no such + /// call (a blit of picture 3 into both planes), each plane's first acquire names the + /// general layout; Direct3D 11 then reads picture 3 exactly, and rt's next read, whose + /// acquire names the general layout too, is picture 3's exactly. On a surface Direct3D 11 + /// draws first, reported by `external_writes_done` before rt's commits, every acquire + /// names the general layout and rt reads picture 1 exactly twice. The acquires are read + /// from the record the hand-over keeps for the device tests (`Work::acquired`). The + /// Khronos validation layer does not track this import's layout, so it is no check here: + /// on the UHD 630 its 1.4.363.0 reported neither a first acquire from the general layout + /// (job m3-max-76170) nor one from the undefined layout (job m3-max-76174). #[test] - fn every_device_acquires_a_direct3d_11_plane_from_undefined_only_before_any_access() { + fn every_device_acquires_a_direct3d_11_plane_from_the_general_layout_first_included() { each_device("import_d3d11_surface_first_use", |name, _, device| { let luid = luid(&device).unwrap_or_else(|| panic!("{name}: no valid LUID")); let d3d = D3d::on_luid(luid) @@ -795,10 +797,7 @@ mod on_device { .collect() }; let mark = || lock(&core.work.acquired).len(); - let (undefined, general) = ( - vk::ImageLayout::UNDEFINED.as_raw(), - vk::ImageLayout::GENERAL.as_raw(), - ); + let general = vk::ImageLayout::GENERAL.as_raw(); // rt's first use, with no Direct3D 11 access before it. let textures = PLANES @@ -829,9 +828,9 @@ mod on_device { ); assert_eq!( written, - [vec![undefined], vec![undefined]], + [vec![general], vec![general]], "{name}: a plane's first acquire before any Direct3D 11 access names the \ - undefined layout" + general layout" ); assert_eq!( later, @@ -868,7 +867,8 @@ mod on_device { assert_eq!( reported, [vec![general, general], vec![general, general]], - "{name}: after external_writes_done, every acquire names the general layout" + "{name}: with external_writes_done first, every acquire names the general \ + layout" ); }); } diff --git a/crates/metal2vulkan-runtime/src/texture.rs b/crates/metal2vulkan-runtime/src/texture.rs index ef71a2753..ec7b018a1 100644 --- a/crates/metal2vulkan-runtime/src/texture.rs +++ b/crates/metal2vulkan-runtime/src/texture.rs @@ -501,9 +501,7 @@ pub(crate) struct Image { linear_attachment: bool, /// The layout its move home starts from: undefined; preinitialized for a texture over a buffer /// in place, whose move home keeps the bytes (over a dma-buf's import, the layout of the - /// bytes the host wrote, which the move's acquire names, `foreign`). A Direct3D 11 plane's is - /// undefined too, the layout it is made in, which its first acquire names - /// ([`handed`](Self::handed)). + /// bytes the host wrote, which the move's acquire names, `foreign`). first: vk::ImageLayout, /// A heap texture's image placed over bytes another resource of its heap reaches /// (`crate::alias`): its move home waits for every earlier command's writes. False for every @@ -515,10 +513,8 @@ pub(crate) struct Image { /// keep the bytes. `None` for every other image. foreign: Option<(vk::Buffer, u64, u64)>, /// An upload recorded its move from `first` to `home`. Read and set under the work lock. A - /// Direct3D 11 plane, which no upload moves, is set by its first acquire, which moves it from - /// `first`, recorded on the submit thread ([`handed`](Self::handed)), or by the consumer's - /// report of Direct3D 11's access, after which Vulkan takes it as general - /// ([`external_access`](Self::external_access)). + /// Direct3D 11 plane is made with it set: it owes no move, as each acquire takes it from the + /// general layout ([`handed`](Self::handed)). homed: AtomicBool, /// How the move home zeroes it, for an image the runtime places for a texture of its own /// (`Source::Plain` and `Source::Managed`); `None` for every other image. @@ -759,24 +755,21 @@ impl Image { } /// A Direct3D 11 plane's hand-over between `VK_QUEUE_FAMILY_EXTERNAL` and the runtime's - /// queue family `family`, to the general layout + /// queue family `family`, from and to the general layout, the first acquire included /// (`VUID-VkImageMemoryBarrier-srcQueueFamilyIndex-12332`, `...-dstQueueFamilyIndex-12331`): /// its acquire (`acquire`), made visible to every later command, or its release, after every - /// earlier command's writes. The plane's first acquire recorded, where the consumer reported - /// no Direct3D 11 access before it ([`external_access`](Self::external_access)), names the - /// undefined layout it is made in as its old layout (`VUID-VkImageCreateInfo-pNext-01443`), - /// and every later one, and every release, the general layout. Recorded on the submit thread. + /// earlier command's writes. Direct3D 11 made the memory, so it is the existing owner the + /// first acquire takes it from, in the layout Vulkan implies for it outside Vulkan, general + /// (section 12.5.2, Table 17); the undefined layout the image is made in is "a placeholder" + /// (section 12.10.1), and naming it would let the move discard what Direct3D 11 wrote + /// (section 12.5.1). Recorded on the submit thread. pub(crate) fn handed(&self, family: u32, acquire: bool) -> vk::ImageMemoryBarrier2<'static> { let (all, access) = ( vk::PipelineStageFlags2::ALL_COMMANDS, vk::AccessFlags2::MEMORY_READ | vk::AccessFlags2::MEMORY_WRITE, ); - let old = match acquire && !self.homed.swap(true, Ordering::Relaxed) { - true => self.first, - false => self.home, - }; let barrier = vk::ImageMemoryBarrier2::default() - .old_layout(old) + .old_layout(self.home) .new_layout(self.home) .image(self.image) .subresource_range(whole(self.aspects)); @@ -797,9 +790,7 @@ impl Image { /// for each acquire, [`Work::home`](crate::submit::Work::home)), with its zeroing between /// two moves where it has one ([`Zero`]). Under the work lock. pub(crate) fn homing(&self) -> Option { - // A Direct3D 11 plane moves home in its first acquire, or is general after Direct3D 11's - // access ([`handed`](Self::handed)): no upload moves it. - if self.d3d11_plane() || self.homed.swap(true, Ordering::Relaxed) { + if self.homed.swap(true, Ordering::Relaxed) { return None; } // A drawable's image moves home at each acquire: from the present layout after a present. @@ -898,14 +889,6 @@ impl Image { matches!(self.zero, Some(Zero::Copy { .. })) } - /// A Direct3D 11 plane's access by Direct3D 11 has completed, as the consumer reports it - /// ([`Surface::external_writes_done`](crate::Surface::external_writes_done)): Vulkan takes it - /// as general from then on (section 12.5.2), so its next acquire names the general layout - /// ([`handed`](Self::handed)). On the host alone. - pub(crate) fn external_access(&self) { - self.homed.store(true, Ordering::Relaxed); - } - /// Its move home is owed, recorded by the next upload that holds it ([`homing`](Self::homing)): /// a new image's, or a drawable's at each acquire. Under the work lock. pub(crate) fn owe_home(&self) { @@ -6486,8 +6469,8 @@ pub(crate) struct SurfaceImage { pub(crate) view_formats: Vec, pub(crate) block: Option>, /// A Direct3D 11 texture's (`Device::import_d3d11_surface`, on Windows): no upload moves its - /// image, made undefined: its first acquire moves it to the general layout, or Vulkan takes - /// it as general after Direct3D 11's access (section 12.5.2, [`Image::handed`]). + /// image, made undefined as a placeholder; each acquire takes it from the general layout, + /// the layout Vulkan implies for it outside Vulkan (section 12.5.2, [`Image::handed`]). pub(crate) d3d11: bool, /// The image is `LINEAR` and its format renders only through /// `VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV` (`crate::surface::Query::plane`): @@ -6533,8 +6516,8 @@ impl Device { /// The texture of a surface plane's image, at `index` as for [`Device::new_texture`]: its /// home layout general, from undefined in the next upload, which goes ahead of every command - /// buffer committed after the make, or, a Direct3D 11 texture's, from undefined in its first - /// acquire or general after Direct3D 11's access ([`Image::handed`]). Its format is the + /// buffer committed after the make, or, a Direct3D 11 texture's, general as each acquire + /// takes it, with no move ([`Image::handed`]). Its format is the /// descriptor's, a view of the image's own where they differ. The texture holds the image, /// which its drop frees with its memory. It takes `unit`'s id in the hazard sets, the /// surface's ([`HeapId::unit`]). @@ -6632,9 +6615,9 @@ impl Device { linear_attachment: made.linear_attachment, first: vk::ImageLayout::UNDEFINED, over: false, - // A Direct3D 11 plane's move from undefined is its first acquire's, or its access by - // Direct3D 11 makes it general: no upload moves it (`Image::handed`). - homed: AtomicBool::new(false), + // A Direct3D 11 plane owes no move: each acquire takes it from the general layout + // (`Image::handed`). + homed: AtomicBool::new(general), foreign: None, zero: None, drawable: None, @@ -6652,7 +6635,7 @@ impl Device { let looped = sampled.filter(|_| image.looped()); // SAFETY: the texture's views are live; its image is in its home layout whenever // work uses it: the upload that moves it goes ahead of that work, or its acquire - // does, or it is general after the other API's access. + // takes it general. let owner = unsafe { (core.arrays).place_texture( &core.device,