Runtime: the Direct3D 11 tests and the sparse wait compile on Windows without warnings

Three fixes the Windows cross-build of 7c5df5a317 found (the gnullvm target under --cfg m2v_gpu,
job m3-max-76160):

- The maxExtent refusal test printed a vk::Extent3D and the first-use test compared and printed
  vk::ImageLayout values with Debug, which ash's types do not implement here: the extent prints
  as its three numbers, and the layouts compare and print as their raw values.
- Since the part builder returns the parts, the only change to them after it is the sparse bind's
  wait, made on Unix hosts alone, so `let mut parts` was an unused mut on Windows (a warning, an
  error under -D warnings). The owed wait is now read into one binding on every host, None where
  the host has no such import, and the mutation compiles everywhere.

No behaviour changes.
This commit is contained in:
Anees Iqbal committed 2026-11-26 22:59:32 -08:00
1 parent 7c5df5a317
commit 74c3940054
2 files changed
+15 -6

No files matched your search

+5 -1
View File
@@ -2854,7 +2854,11 @@ fn submit(core: &Core, value: u64, uploads: Vec<Upload>, batch: Batch) {
// it, and every later command, in this submission and after it, is ordered after that
// wait (`crate::import::Sparse`).
#[cfg(unix)]
if let Some((timeline, value)) = (core.imports.sparse.as_ref()).and_then(|s| s.owed()) {
let owed = (core.imports.sparse.as_ref()).and_then(|s| s.owed());
// No such import on any other host.
#[cfg(not(unix))]
let owed: Option<(vk::Semaphore, u64)> = None;
if let Some((timeline, value)) = owed {
if let Some(first) = parts.first_mut().and_then(|(_, part)| part.first_mut()) {
first.waits.push(
vk::SemaphoreSubmitInfo::default()
+10 -5
View File
@@ -116,10 +116,11 @@ mod on_device {
let mut past = luma;
past.descriptor.width = most + 1;
let error = device.import_d3d11_surface(&[past]).err();
let max = made.max_extent;
println!(
"d3d11: {name}: the import query's maxExtent for the luma {:?}; a plane {} wide: \
{error:?}",
made.max_extent,
[max.width, max.height, max.depth],
most + 1
);
assert!(
@@ -724,21 +725,25 @@ mod on_device {
.unwrap_or_else(|| panic!("{name}: no DXGI adapter of LUID {luid:02x?}"));
let core = device.core();
// The old layouts of the acquires of `surface`'s planes recorded since `from`,
// each plane's in order, the luma's first.
let acquires = |surface: &Surface, from: usize| -> Vec<Vec<vk::ImageLayout>> {
// each plane's in order, the luma's first, as their raw values (undefined 0,
// general 1).
let acquires = |surface: &Surface, from: usize| -> Vec<Vec<i32>> {
let recorded = lock(&core.work.acquired);
(surface.planes().iter())
.map(|texture| {
let image = Arc::as_ptr(&texture.held_image()) as usize;
(recorded[from..].iter())
.filter(|&&(at, _)| at == image)
.map(|&(_, layout)| layout)
.map(|&(_, layout)| layout.as_raw())
.collect()
})
.collect()
};
let mark = || lock(&core.work.acquired).len();
let (undefined, general) = (vk::ImageLayout::UNDEFINED, vk::ImageLayout::GENERAL);
let (undefined, general) = (
vk::ImageLayout::UNDEFINED.as_raw(),
vk::ImageLayout::GENERAL.as_raw(),
);
// rt's first use, with no Direct3D 11 access before it.
let textures = PLANES