[PR #683] d3d12_xs: serialize SM 6.6 heap-directly-indexed root signature flags on Windows 10 #723

Open
opened 2026-11-26 20:18:50 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/683
Author: @Kokonotcu
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/rootsig-sm66-flags-win10


📝 Commits (1)

  • d102966 d3d12_xs: serialize SM 6.6 heap-directly-indexed root signature flags on Windows 10

📊 Changes

4 files changed (+166 additions, -2 deletions)

View changed files

📝 runtime/shims/d3d12_xs.cpp (+83 -2)
📝 runtime/shims/d3d12_xs_rootsig.cpp (+35 -0)
📝 runtime/shims/d3d12_xs_rootsig.h (+7 -0)
📝 runtime/test/d3d12_xs_root_signature_test.cpp (+41 -0)

📄 Description

Windows 10's built-in d3d12.dll refuses root signature flags 0x400 and 0x800 (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED / SAMPLER_HEAP_DIRECTLY_INDEXED) with "Unsupported bit-flag set (root signature flags c00)".

The retail title builds each program's root signature from the shader's PRIV chunk and serializes it through D3D12SerializeVersionedRootSignature. A refusal leaves a null program in the pass table, and the title crashed reading it (game_scarlett_master.exe+0xb5a5f8, a read of [0+0x68]) about 15 s into every boot on a Windows 10 host. Measured with a new log of the host's error message:

[rt] d3d12_xs: D3D12SerializeVersionedRootSignature (version 2, 2 parameter(s), flags 0xc00) failed 0x80070057: Unsupported bit-flag set (root signature flags c00).

Change

  • The flags the host serializer refuses are asked once per bit (0x100..0x800) with an empty 1.1 description.
  • The description is serialized without those bits, and they are written back into the blob's RTS0 flags word; the DXBC container hash is recomputed (an all-zero hash stays zero). CreateRootSignature therefore still sees the heap-indexing flags.
  • Serializer failures are logged (first 8) with the host's message.
  • d3d12_xs_root_signature_test covers it: a 1.1 description with 0x400 | 0x800 | 0x1 serializes, its RTS0 flags keep all three bits and its hash is valid.

Verified: Windows 10 19045, RTX 3080 Laptop: d3d12_xs_root_signature_test passes (the 1.2 case skips, as before, on a d3d12.dll without 1.2). On the retail boot the b5a5f8 crash is gone and the run continues past it.

On a host whose d3d12.dll already accepts the flags (Windows 11 / Agility), the probe finds nothing refused and the path is unchanged.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/683 **Author:** [@Kokonotcu](https://github.com/Kokonotcu) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/rootsig-sm66-flags-win10` --- ### 📝 Commits (1) - [`d102966`](https://github.com/ubiquitarianism/leonida/commit/d10296689500467959f593b060728f2f9ba8cbd4) d3d12_xs: serialize SM 6.6 heap-directly-indexed root signature flags on Windows 10 ### 📊 Changes **4 files changed** (+166 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_xs.cpp` (+83 -2) 📝 `runtime/shims/d3d12_xs_rootsig.cpp` (+35 -0) 📝 `runtime/shims/d3d12_xs_rootsig.h` (+7 -0) 📝 `runtime/test/d3d12_xs_root_signature_test.cpp` (+41 -0) </details> ### 📄 Description Windows 10's built-in d3d12.dll refuses root signature flags 0x400 and 0x800 (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED / SAMPLER_HEAP_DIRECTLY_INDEXED) with "Unsupported bit-flag set (root signature flags c00)". The retail title builds each program's root signature from the shader's PRIV chunk and serializes it through `D3D12SerializeVersionedRootSignature`. A refusal leaves a null program in the pass table, and the title crashed reading it (`game_scarlett_master.exe+0xb5a5f8`, a read of `[0+0x68]`) about 15 s into every boot on a Windows 10 host. Measured with a new log of the host's error message: ``` [rt] d3d12_xs: D3D12SerializeVersionedRootSignature (version 2, 2 parameter(s), flags 0xc00) failed 0x80070057: Unsupported bit-flag set (root signature flags c00). ``` **Change** - The flags the host serializer refuses are asked once per bit (0x100..0x800) with an empty 1.1 description. - The description is serialized without those bits, and they are written back into the blob's RTS0 flags word; the DXBC container hash is recomputed (an all-zero hash stays zero). `CreateRootSignature` therefore still sees the heap-indexing flags. - Serializer failures are logged (first 8) with the host's message. - `d3d12_xs_root_signature_test` covers it: a 1.1 description with 0x400 | 0x800 | 0x1 serializes, its RTS0 flags keep all three bits and its hash is valid. **Verified**: Windows 10 19045, RTX 3080 Laptop: `d3d12_xs_root_signature_test` passes (the 1.2 case skips, as before, on a d3d12.dll without 1.2). On the retail boot the b5a5f8 crash is gone and the run continues past it. On a host whose d3d12.dll already accepts the flags (Windows 11 / Agility), the probe finds nothing refused and the path is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#723
No description provided.