From 45f7be90b9cb90ea6342caef89ff59ab0e57f94e Mon Sep 17 00:00:00 2001 From: lixonik <71736299+lixonik@users.noreply.github.com> Date: Tue, 1 Dec 2026 12:38:25 +0300 Subject: [PATCH] d3d12-gpu: drop unused SM 6.6 root signature flags in depth_bounds test --- d3d12/crates/leonida-gpu/src/pipeline/host.rs | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/d3d12/crates/leonida-gpu/src/pipeline/host.rs b/d3d12/crates/leonida-gpu/src/pipeline/host.rs index 3ab7cbc626..62a093bd12 100644 --- a/d3d12/crates/leonida-gpu/src/pipeline/host.rs +++ b/d3d12/crates/leonida-gpu/src/pipeline/host.rs @@ -1622,7 +1622,36 @@ mod tests { let dir = tempfile::tempdir().unwrap(); let vs = compile(&dxc, dir.path(), VS, "vs_6_5"); let ps = compile(&dxc, dir.path(), PS, "ps_6_5"); - let (root, root_blob) = root_signature(&host.device, &[], &[], false).unwrap(); + // Empty root signature without SM 6.6 `*_HEAP_DIRECTLY_INDEXED` flags: the + // shaders bind no descriptors, and unit tests run against inbox `d3d12.dll` + // (which rejects SM 6.6 root signature flags with `E_INVALIDARG` on Windows 10). + let (root, root_blob) = { + let desc = D3D12_VERSIONED_ROOT_SIGNATURE_DESC { + Version: windows::Win32::Graphics::Direct3D12::D3D_ROOT_SIGNATURE_VERSION_1_1, + Anonymous: D3D12_VERSIONED_ROOT_SIGNATURE_DESC_0 { + Desc_1_1: D3D12_ROOT_SIGNATURE_DESC1 { + NumParameters: 0, + pParameters: std::ptr::null(), + NumStaticSamplers: 0, + pStaticSamplers: std::ptr::null(), + Flags: D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT, + }, + }, + }; + // SAFETY: self-contained empty root signature descriptor; blob is read before drop. + unsafe { + let mut blob: Option = None; + D3D12SerializeVersionedRootSignature(&desc, &mut blob, None).unwrap(); + let blob = blob.unwrap(); + let bytes = std::slice::from_raw_parts( + blob.GetBufferPointer().cast::(), + blob.GetBufferSize(), + ) + .to_vec(); + let root: ID3D12RootSignature = host.device.CreateRootSignature(0, &bytes).unwrap(); + (root, bytes) + } + }; let mut g = GraphicsState::default(); // Subobject 21 (`DEPTH_STENCIL1`) with `DepthBoundsTestEnable = true`,