Skip to content

d3d12: name invalid_predication in the ExecuteCommandLists log - #9132

Open
sgonzalez-glitch wants to merge 1 commit into
ItsNotRexed:mainfrom
sgonzalez-glitch:fix/name-invalid-predication
Open

sgonzalez-glitch wants to merge 1 commit into
ItsNotRexed:mainfrom
sgonzalez-glitch:fix/name-invalid-predication

Conversation

@sgonzalez-glitch

Copy link
Copy Markdown

Claimed in the coordination issue as: #8868 (comment) (new item)

What and why

name() in runtime/shims/d3d12_com.cpp had no case for ReplayResult::invalid_predication, which runtime/src/vulkan_replay.h returns for a SetPredication buffer offset outside its buffer. A batch refused for that reason was logged as ExecuteCommandLists failed: ?.

Close already refuses an out-of-range offset (d3d12_close_parity, "SetPredication at offset 4"), so this is the replay-time path, where the check runs against the binding seen at execution. It is not a common case, but the log should still say why the batch was refused.

A missing enumerator in that switch is now a compile error: MSVC C4062 and clang -Wswitch, scoped with push/pop to this one function. The next value added to ReplayResult then can't fall through to "?" again.

Tested

Windows 11, NVIDIA GeForce RTX 2080, driver 621.24 (32.0.16.2124), MSVC 19.44 RelWithDebInfo, on main 867d922f0:

AI-assisted: yes

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. (Not a translator change.)

name() had no case for ReplayResult::invalid_predication, which
vulkan_replay.h returns for a SetPredication buffer offset outside its
buffer, so a refused batch was logged as "ExecuteCommandLists failed: ?".
Close already refuses an out-of-range offset, so this is the replay-time
path (the binding seen at execution), but the log should still say why.

A missing enumerator in that switch is now a compile error (MSVC C4062,
clang -Wswitch), so the next ReplayResult can't fall through to "?".
Checked by removing the new case: MSVC stops with C4062 on the switch.

Tested on Windows 11, NVIDIA GeForce RTX 2080 (621.24), MSVC 19.44
RelWithDebInfo: builds without new warnings; full runtime ctest 261/264,
11 skipped, the 3 failures are the ones main has on this machine.

@abnalstlll-byte abnalstlll-byte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Windows review (commit 332327c50caa6eb337ed23a9829dcf2511a69e55)

What changed:

  • runtime/shims/d3d12_com.cpp:
    • Adds explicit case mapping for ReplayResult::invalid_predication: returns "invalid predication buffer or offset".
    • Fixes unhandled enum falling through to "?" in ExecuteCommandLists replay diagnostics.
    • Enforces compiler switch exhaustiveness warnings/errors (-Wswitch / #pragma warning(error: 4062)).

Verification:

  • Clean diff: correct diagnostic string mapping.
  • No game data.

LGTM!

@lohant27-netizen

Copy link
Copy Markdown

Tested 332327c50 on Windows 11 (10.0.26300), NVIDIA GeForce RTX 5070 (driver 32.0.16.2101, subgroup 32), MSVC with SDK 10.0.26100, Release, merged onto main 867d922f0 together with #9189, #9137, #9068, #9175, #9176 and #9132 (no conflicts): pass.

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.

3 participants