Skip to content

Runtime: accept global realtime queues when the base-priority privilege is enabled (D3D-236) - #1819

Closed
Callimann8 wants to merge 2 commits into
ItsNotRexed:mainfrom
Callimann8:claude/project-thread-b0zbdl
Closed

Callimann8 wants to merge 2 commits into
ItsNotRexed:mainfrom
Callimann8:claude/project-thread-b0zbdl

Conversation

@Callimann8

Copy link
Copy Markdown

Claimed in the coordination issue as: D3D-236 (#1745)

What and why

ID3D12Device::CreateCommandQueue refused D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME with DXGI_ERROR_ACCESS_DENIED unconditionally. The PC runtime accepts it when the process token has SeIncreaseBasePriorityPrivilege enabled (host returned 0x0 on an elevated Windows 10 session, #1737). The shim now reads the process token (TokenPrivileges) and refuses only when that privilege is absent or not enabled, so it agrees with the host either way.

The privilege name is spelled as a wide literal because SE_INC_BASE_PRIORITY_NAME is a TEXT() macro and the runtime builds without UNICODE.

Tested

  • d3d12_vulkan_device_test (ctest -R d3d12_vulkan_device), unelevated: 1/1 passed. The "command queue: global realtime priority" case agrees with the host (both refuse; log CreateCommandQueue refused (global realtime priority), type 0).
  • GPU: NVIDIA GeForce RTX 4070, driver 621.14, Vulkan 1.4.357; Windows 11 Pro build 26300; MSVC from Visual Studio 18 (2026), Windows SDK 10.0.26100.0; Vulkan headers from LEONIDA_VULKAN_HEADERS_FETCH=ON.
  • Not tested: an elevated session with the privilege enabled (the accepting path). A check from someone who can run the test elevated would cover it.

AI-assisted (Claude Code).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a, no translator change)

…ge is enabled (D3D-236)

CreateCommandQueue refused D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME with
DXGI_ERROR_ACCESS_DENIED unconditionally. The PC runtime accepts it when the
process token has SeIncreaseBasePriorityPrivilege enabled (measured on an
elevated Windows 10 session in ItsNotRexed#1737), so check the token instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YZ2Pr9hXBAWjPeBhWbwSeG
…-236)

SE_INC_BASE_PRIORITY_NAME is a TEXT() macro and the runtime builds without
UNICODE, so it expanded to a narrow string for LookupPrivilegeValueW (C2664).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YZ2Pr9hXBAWjPeBhWbwSeG
@CowBoYdu76

Copy link
Copy Markdown
Contributor

Tested 70bdb06 on RTX 4070 SUPER (NVIDIA 616.64) and Intel UHD 770 (101.7092), Windows 11, MSVC 19.44, unelevated: pass

#1817 and #1819 both implement D3D-236, and both pass the same runs here.
#1817 additionally has a test override, so its accepting path is exercised without elevation.

@Callimann8

Copy link
Copy Markdown
Author

Closing in favour of #1817, which landed first for D3D-236 and also covers the accepting path with a test override. Our run on RTX 4070 (621.14, Win11, unelevated) passed for the same case, for what it's worth as a second data point on #1817.

@sanakontorov-sys

Copy link
Copy Markdown

Tested 70bdb06 on NVIDIA GeForce RTX 5060 (Blackwell, driver 617.42, Vulkan 1.4.351), Windows 11 Pro build 26300, MSVC (VS 2026), LLVM_MC set, scripts\build_runtime.ps1, then ctest -j 4: pass for this change. d3d12_vulkan_device and vulkan_device_filter pass; 106 of 107 run tests pass. The one failure is d3d12_draw ("fence signal 4 is not above 30"), which fails the same way on main 003e781 here and is fixed by #1807. Run from a normal (non-elevated) user shell, so the privilege-absent path is what ran. This PR adds no test of its own; #1817 covers the same item (D3D-236) and also passes here.

(Run with an AI coding agent.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants