[PR #1386] d3d12: accept the console-only command queue flag 0x2 #1416

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1386
Author: @JoshRob297
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/console-queue-flag


📝 Commits (1)

  • 82110a6 [PATCH] d3d12: accept the console-only command queue flag 0x2

📊 Changes

2 files changed (+19 additions, -1 deletions)

View changed files

📝 docs/retail_boot_chain.md (+5 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+14 -1)

📄 Description

PR 2 — fix/console-queue-flag

Title: d3d12: accept the console-only command queue flag 0x2

Branch: fix/console-queue-flag (commit 585706202) — patch: PR-2-console-queue-flag.patch


Claimed in the coordination issue as:

Depends on: none

Fixes: none (there is no issue for this in this repository; it is a one-call behaviour change in the D3D12 layer)

What and why

Right after device creation the title asks for a compute queue whose D3D12_COMMAND_QUEUE_DESC.Flags is 0x2.
ID3D12Device::CreateCommandQueue in runtime/shims/d3d12_vulkan_device.cpp mirrors the PC runtime, which has one
queue flag (D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT) and refuses a description that carries any other bit, so
the call answered E_INVALIDARG and the queue the title expected was never created. The title does not check it and
stops on its own assert:

assert in the title, game_scarlett_master.exe+0x2478866

With the bit accepted, that stop is gone: the run gets past +0x2478866 and stops later, at the unimplemented
device slot 15 (slot 79 is already routed to ScheduleFrameEventX). This pull request removes one stop; it does not
make the title run.

0x2 has no PC meaning here — nothing in the queue that gets created depends on it:

    // Bits the console accepts in a D3D12_COMMAND_QUEUE_DESC and the PC runtime does not. The title asks for a
    // compute queue with flags = 0x2 right after device creation; with the bit refused, CreateCommandQueue fails and
    // the title stops on its own assert (+0x2478866). The bit has no PC meaning here, so it is accepted and logged.
    static constexpr UINT kConsoleQueueFlags = 0x2u;

so the validation masks it out and lets it through:

            (desc->Flags & ~(D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT | kConsoleQueueFlags)) || desc->NodeMask > 1) {

The queue is built from Type, Priority and the queue family as before; Flags is only stored in the description
the queue keeps, so GetDesc hands the bit back exactly as the caller passed it — which is what the console does.
Bit 0x2 is logged once so a trace shows why the value was accepted. Every other unknown bit is still refused, and
that refusal path now prints what it received (priority=… flags=… node=…), which is what identifies this case in a
trace in the first place. docs/retail_boot_chain.md §3.2 says the flag exists.

Reviewers: d3d12_vulkan_device_test's "command queue: flag 0x80" case still refuses as before, and 0x2 is
deliberately not added to that comparison table — the table compares against the host runtime, which refuses it, so
a 0x2 row there would fail by design.

Tested

Built with clang-cl against the xwin SDK, from the commit in this branch, clean build directory (Linux host,
-DCMAKE_BUILD_TYPE=Release -DLEONIDA_BUILD_WINDOWS_RUNTIME=ON -DLEONIDA_VULKAN_HEADERS_FETCH=ON):

$ cmake -S runtime -B /tmp/b-ap2 --toolchain "$PWD/runtime/cmake/clang-cl-xwin.cmake" \
    -DXWIN_DIR=$HOME/.local/share/xwin-sdk -DCMAKE_BUILD_TYPE=Release \
    -DLEONIDA_BUILD_WINDOWS_RUNTIME=ON -DLEONIDA_VULKAN_HEADERS_FETCH=ON
...
-- Configuring done (6.0s)
-- Generating done (0.2s)
-- Build files have been written to: /tmp/b-ap2

$ cmake --build /tmp/b-ap2 --target gta6rt -j8
...
[ 20%] Building CXX object CMakeFiles/gta6rt_d3d12_com.dir/shims/d3d12_vulkan_device.cpp.obj
...
[100%] Linking CXX executable gta6rt.exe
[100%] Built target gta6rt
=== build exit=0 ===

d3d12_vulkan_device.cpp reports no warning on any of the changed lines — the file's other warnings are all
pre-existing, at lines this change does not touch (gta6rt.exe is 4,001,792 bytes).
The git apply --check of PR-2-console-queue-flag.patch on main (6293c1c4f) is clean.

What this does not show: a GPU run. The two offsets quoted above (+0x2478866 before, device slot 15 after) come from
runs of the console executable in the fork this change comes from, not from a run here; the executable is not part of
this repository and is not part of the change. There is no test in the tree that can create a queue with Flags = 0x2
and check the acceptance without a device, so the evidence for the call itself is the build plus the code path above.

GPUs tested: n/a — build only in this environment; no GPU test run accompanies this change.

AI-assisted: yes

Checklist

  • Based on current main (6293c1c4f) and the patch applies cleanly (git apply --check on main).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md — not applicable.

Where this comes from

This change was written in a fork of the project that no longer exists: the repositories of this lineage were taken
down on 24 November 2026, and this is one of the pieces it had that main here does not. It contains nothing from
the title — no executable, archive, shader, texture, audio, video or a log quoting one. Only runtime code and
documentation.


🔄 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/1386 **Author:** [@JoshRob297](https://github.com/JoshRob297) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/console-queue-flag` --- ### 📝 Commits (1) - [`82110a6`](https://github.com/ubiquitarianism/leonida/commit/82110a64f1d5633f4aa1f85101ef982838a56dce) [PATCH] d3d12: accept the console-only command queue flag 0x2 ### 📊 Changes **2 files changed** (+19 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/retail_boot_chain.md` (+5 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+14 -1) </details> ### 📄 Description # PR 2 — `fix/console-queue-flag` **Title:** `d3d12: accept the console-only command queue flag 0x2` **Branch:** `fix/console-queue-flag` (commit `585706202`) — patch: `PR-2-console-queue-flag.patch` --- Claimed in the coordination issue as: <!-- fill in the item ID (or the link to the claim) before opening --> Depends on: none Fixes: none (there is no issue for this in this repository; it is a one-call behaviour change in the D3D12 layer) ### What and why Right after device creation the title asks for a compute queue whose `D3D12_COMMAND_QUEUE_DESC.Flags` is `0x2`. `ID3D12Device::CreateCommandQueue` in `runtime/shims/d3d12_vulkan_device.cpp` mirrors the PC runtime, which has one queue flag (`D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT`) and refuses a description that carries any other bit, so the call answered `E_INVALIDARG` and the queue the title expected was never created. The title does not check it and stops on its own assert: ``` assert in the title, game_scarlett_master.exe+0x2478866 ``` With the bit accepted, that stop is gone: the run gets past `+0x2478866` and stops later, at the unimplemented device slot 15 (slot 79 is already routed to `ScheduleFrameEventX`). This pull request removes one stop; it does not make the title run. `0x2` has no PC meaning here — nothing in the queue that gets created depends on it: ```cpp // Bits the console accepts in a D3D12_COMMAND_QUEUE_DESC and the PC runtime does not. The title asks for a // compute queue with flags = 0x2 right after device creation; with the bit refused, CreateCommandQueue fails and // the title stops on its own assert (+0x2478866). The bit has no PC meaning here, so it is accepted and logged. static constexpr UINT kConsoleQueueFlags = 0x2u; ``` so the validation masks it out and lets it through: ```cpp (desc->Flags & ~(D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT | kConsoleQueueFlags)) || desc->NodeMask > 1) { ``` The queue is built from `Type`, `Priority` and the queue family as before; `Flags` is only stored in the description the queue keeps, so `GetDesc` hands the bit back exactly as the caller passed it — which is what the console does. Bit `0x2` is logged once so a trace shows why the value was accepted. Every other unknown bit is still refused, and that refusal path now prints what it received (`priority=… flags=… node=…`), which is what identifies this case in a trace in the first place. `docs/retail_boot_chain.md` §3.2 says the flag exists. Reviewers: `d3d12_vulkan_device_test`'s "command queue: flag 0x80" case still refuses as before, and `0x2` is deliberately not added to that comparison table — the table compares against the host runtime, which refuses it, so a `0x2` row there would fail by design. ### Tested Built with clang-cl against the xwin SDK, from the commit in this branch, clean build directory (Linux host, `-DCMAKE_BUILD_TYPE=Release -DLEONIDA_BUILD_WINDOWS_RUNTIME=ON -DLEONIDA_VULKAN_HEADERS_FETCH=ON`): ``` $ cmake -S runtime -B /tmp/b-ap2 --toolchain "$PWD/runtime/cmake/clang-cl-xwin.cmake" \ -DXWIN_DIR=$HOME/.local/share/xwin-sdk -DCMAKE_BUILD_TYPE=Release \ -DLEONIDA_BUILD_WINDOWS_RUNTIME=ON -DLEONIDA_VULKAN_HEADERS_FETCH=ON ... -- Configuring done (6.0s) -- Generating done (0.2s) -- Build files have been written to: /tmp/b-ap2 $ cmake --build /tmp/b-ap2 --target gta6rt -j8 ... [ 20%] Building CXX object CMakeFiles/gta6rt_d3d12_com.dir/shims/d3d12_vulkan_device.cpp.obj ... [100%] Linking CXX executable gta6rt.exe [100%] Built target gta6rt === build exit=0 === ``` `d3d12_vulkan_device.cpp` reports no warning on any of the changed lines — the file's other warnings are all pre-existing, at lines this change does not touch (`gta6rt.exe` is 4,001,792 bytes). The `git apply --check` of `PR-2-console-queue-flag.patch` on `main` (`6293c1c4f`) is clean. What this does not show: a GPU run. The two offsets quoted above (+0x2478866 before, device slot 15 after) come from runs of the console executable in the fork this change comes from, not from a run here; the executable is not part of this repository and is not part of the change. There is no test in the tree that can create a queue with `Flags = 0x2` and check the acceptance without a device, so the evidence for the call itself is the build plus the code path above. GPUs tested: n/a — build only in this environment; no GPU test run accompanies this change. AI-assisted: yes ### Checklist - [x] Based on current `main` (`6293c1c4f`) and the patch applies cleanly (`git apply --check` on `main`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md` — not applicable. ### Where this comes from This change was written in a fork of the project that no longer exists: the repositories of this lineage were taken down on 24 November 2026, and this is one of the pieces it had that `main` here does not. It contains nothing from the title — no executable, archive, shader, texture, audio, video or a log quoting one. Only runtime code and documentation. --- <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#1416
No description provided.