diff --git a/crates/victory-gpu/src/descriptor/host.rs b/crates/victory-gpu/src/descriptor/host.rs index f84595e..74e4bf5 100644 --- a/crates/victory-gpu/src/descriptor/host.rs +++ b/crates/victory-gpu/src/descriptor/host.rs @@ -1375,6 +1375,16 @@ fn fits(texture: &ID3D12Resource, castable: &[u32], mut format: Option<&mut DXGI format.0 = linear as i32; } let view = format.as_ref().map_or(0, |f| f.0 as u32); + // A typed unordered view in a format the host cannot store to + // (B5G5R5A1_UNORM on NVIDIA) removes the device when made, in the + // texture's own format too: the slot stays null, its writes dropped. + // The format checked is the one the view is made in: a typed + // texture's own unless the requested one is castable (below). + let typed = if view == 0 || (!typeless && !castable.contains(&view)) { own } else { view }; + if unordered && !(view == 0 && typeless) && !typed_store(typed) { + once!(view = typed, own, "an unordered view in a format the host cannot store"); + return false; + } if view == 0 { return !typeless && (!unordered || typed_store(own)); }