GPU: echo requested format and report required count in DXGI GetDisplayModeList #3466

Open
alexandruiulian201-bot wants to merge 1 commit from upstream-pr/3466 into main
alexandruiulian201-bot commented 2026-11-27 04:00:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexandruiulian201-bot on 2026-11-27T04:00:24Z.


Problem

In crates/victory-gpu/src/dxgi.rs, modes (IDXGIOutput::GetDisplayModeList):

  1. Always writes format: 0 (DXGI_FORMAT_UNKNOWN) instead of echoing the requested format.
  2. Returns MORE_DATA (DXGI_ERROR_MORE_DATA) when out is non-null and *count < 1 without setting *count = 1 to report the required mode count.

Fix

  • Echo the requested format in the returned Mode.
  • Write *count = 1 before returning MORE_DATA when *count < 1.
  • Add synthetic unit test output_modes_reports_count_and_requested_format covering null count, count probe, undersized buffer, and normal mode retrieval.

Verification

  • cargo test -p victory-gpu --lib --locked dxgi::tests::: 3 passed.
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.
  • cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings: clean.
  • cargo run -p xtask --locked -- policy: 191 files ok.

AI-assisted. Synthetic unit test only (no game files used).

<!-- greyfinch-sync:Marvisak/VIctory:issue:5520954658 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3466). Originally posted by [alexandruiulian201-bot](https://github.com/alexandruiulian201-bot) on 2026-11-27T04:00:24Z. --- ### Problem In `crates/victory-gpu/src/dxgi.rs`, `modes` (`IDXGIOutput::GetDisplayModeList`): 1. Always writes `format: 0` (`DXGI_FORMAT_UNKNOWN`) instead of echoing the requested `format`. 2. Returns `MORE_DATA` (`DXGI_ERROR_MORE_DATA`) when `out` is non-null and `*count < 1` without setting `*count = 1` to report the required mode count. ### Fix - Echo the requested `format` in the returned `Mode`. - Write `*count = 1` before returning `MORE_DATA` when `*count < 1`. - Add synthetic unit test `output_modes_reports_count_and_requested_format` covering null count, count probe, undersized buffer, and normal mode retrieval. ### Verification - `cargo test -p victory-gpu --lib --locked dxgi::tests::`: 3 passed. - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: clean. - `cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings`: clean. - `cargo run -p xtask --locked -- policy`: `191 files ok`. AI-assisted. Synthetic unit test only (no game files used).
oni-swr commented 2026-11-27 04:27:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-27T04:27:53Z.


WARP test report (victory-gpu, --lib --locked --no-fail-fast)

OS: Windows 11 Pro 10.0.26200 (build 26200.9974), x64
Host adapter: WARP only (VICTORY_WARP=1 and VICTORY_D3D12_WARP=1; d3d10warp.dll 10.0.26100.9818); no physical GPU used
dxil.dll: Windows SDK 10.0.26100.0, version 1.8.2502.11 (via VICTORY_DXIL)
rustc/cargo: 1.98.1 (48a229cea 2026-09-01)
Base: main 63bcca43c6
Head: 20569dae5b (merged onto main, no conflicts)

pass fail ignored
main 231 0 1
main + PR 232 0 1
  • The new test dxgi::tests::output_modes_reports_count_and_requested_format runs and passes under WARP (not skipped). It is the only difference in the count (+1).
  • The existing dxgi::tests (out_of_range_enumeration_clears_output, startup_walks_from_device_to_output) still pass.

Review note: the test covers the null-count, count-probe, undersized-buffer and normal paths, and it echoes a non-zero requested format (28), so it would fail on the old format: 0. No concerns.

AI-assisted (Claude). Aggregate counts only; no game files used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7209818802 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3466#issuecomment-7209818802). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-27T04:27:53Z. --- **WARP test report** (`victory-gpu`, `--lib --locked --no-fail-fast`) OS: Windows 11 Pro 10.0.26200 (build 26200.9974), x64 Host adapter: WARP only (VICTORY_WARP=1 and VICTORY_D3D12_WARP=1; d3d10warp.dll 10.0.26100.9818); no physical GPU used dxil.dll: Windows SDK 10.0.26100.0, version 1.8.2502.11 (via VICTORY_DXIL) rustc/cargo: 1.98.1 (48a229cea 2026-09-01) Base: main 63bcca43c6a0 Head: 20569dae5b43 (merged onto main, no conflicts) | | pass | fail | ignored | |---|---|---|---| | main | 231 | 0 | 1 | | main + PR | 232 | 0 | 1 | - The new test `dxgi::tests::output_modes_reports_count_and_requested_format` runs and passes under WARP (not skipped). It is the only difference in the count (+1). - The existing `dxgi::tests` (`out_of_range_enumeration_clears_output`, `startup_walks_from_device_to_output`) still pass. Review note: the test covers the null-count, count-probe, undersized-buffer and normal paths, and it echoes a non-zero requested format (28), so it would fail on the old `format: 0`. No concerns. AI-assisted (Claude). Aggregate counts only; no game files used.
cloph-dsp commented 2026-11-27 05:31:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T05:31:50Z.


Independent CPU-only verification of PR #3466 (DXGI: GetDisplayModeList reports count and requested format).

  • Windows, rustc/cargo 1.100.0/MSVC, worktree-local CARGO_TARGET_DIR (D:\Victory-Contrib\target-3466-watch), CARGO_BUILD_JOBS=2.
  • Head 20569dae5b43964b1c6f1375b245f77a41c12f28, merge base 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • Command: cargo test --locked -p victory-gpu --lib -- dxgi::tests::output_modes_reports_count_and_requested_format --exact --test-threads=1 --quiet -> 1 passed; 0 failed; 232 filtered.
  • Negative control: git grep -F for the new test name on 63bcca4 returned no hits (test absent on base).
  • git diff --check 63bcca4 HEAD exit 0 (clean).
  • Only the named synthetic test was replayed; the full crate suite and real display-mode enumeration were not exercised. This PR already has a WARP verification report from oni-swr; this is an additional Windows/MSVC data point with no WARP/diagnostics feature.
  • AI-assisted (Hy4 flash). GPU/driver: N/A for this synthetic CPU test (no D3D12 adapter selection). No game data, assets, shaders, DRM or decrypt used.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7210711840 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3466#issuecomment-7210711840). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T05:31:50Z. --- Independent CPU-only verification of PR #3466 (`DXGI: GetDisplayModeList reports count and requested format`). - Windows, rustc/cargo 1.100.0/MSVC, worktree-local `CARGO_TARGET_DIR` (`D:\Victory-Contrib\target-3466-watch`), `CARGO_BUILD_JOBS=2`. - Head `20569dae5b43964b1c6f1375b245f77a41c12f28`, merge base `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - Command: `cargo test --locked -p victory-gpu --lib -- dxgi::tests::output_modes_reports_count_and_requested_format --exact --test-threads=1 --quiet` -> `1 passed; 0 failed; 232 filtered`. - Negative control: `git grep -F` for the new test name on `63bcca4` returned no hits (test absent on base). - `git diff --check 63bcca4 HEAD` exit 0 (clean). - Only the named synthetic test was replayed; the full crate suite and real display-mode enumeration were not exercised. This PR already has a WARP verification report from oni-swr; this is an additional Windows/MSVC data point with no WARP/diagnostics feature. - AI-assisted (Hy4 flash). GPU/driver: N/A for this synthetic CPU test (no D3D12 adapter selection). No game data, assets, shaders, DRM or decrypt used.
futurepro62 commented 2026-11-27 09:27:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-27T09:27:14Z.


NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head 20569da (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: output_modes_reports_count_and_requested_format.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7214698791 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3466#issuecomment-7214698791). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-27T09:27:14Z. --- NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head `20569da` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **867 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `output_modes_reports_count_and_requested_format`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
andrewpozdnakov7-jpg commented 2026-11-28 07:46:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T07:46:14Z.


I combined #3466 at 20569da with the display-size override from #1701 at fb27a56 on main 63bcca4. The conflict only affected the two tests added at the end of dxgi.rs. The branch keeps both original commits and their authors.

With VICTORY_MODE=1920x1080 and a request for format 87, an isolated CPU fixture using each revision's mode enumeration code returned:

Revision Reported mode Format Count returned with MORE_DATA
main 3840×2160 0 0
#1701 1920×1080 0 0
#3466 3840×2160 87 1
Combined 1920×1080 87 1

The same fixture checked formats 0, 28 and 87 with the variable unset, valid and out of range. The combined code used 3840×2160 for an unset or invalid setting. It kept the 60/1 progressive mode and left the output storage untouched on MORE_DATA. All four repository DXGI tests passed with and without the override. Strict GPU Clippy and asset policy passed. This checks mode enumeration on the CPU.

Integration branch c2a27f2

Please retain the Git authors on cherry-pick or rebase. If folding the resolution into another commit, please include:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7236151119 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3466#issuecomment-7236151119). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T07:46:14Z. --- I combined #3466 at `20569da` with the display-size override from #1701 at `fb27a56` on `main` `63bcca4`. The conflict only affected the two tests added at the end of `dxgi.rs`. The branch keeps both original commits and their authors. With `VICTORY_MODE=1920x1080` and a request for format 87, an isolated CPU fixture using each revision's mode enumeration code returned: | Revision | Reported mode | Format | Count returned with `MORE_DATA` | | --- | --- | ---: | ---: | | `main` | 3840×2160 | 0 | 0 | | #1701 | 1920×1080 | 0 | 0 | | #3466 | 3840×2160 | 87 | 1 | | Combined | 1920×1080 | 87 | 1 | The same fixture checked formats 0, 28 and 87 with the variable unset, valid and out of range. The combined code used 3840×2160 for an unset or invalid setting. It kept the 60/1 progressive mode and left the output storage untouched on `MORE_DATA`. All four repository DXGI tests passed with and without the override. Strict GPU Clippy and asset policy passed. This checks mode enumeration on the CPU. [Integration branch `c2a27f2`](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/review/3466-1701-display-mode) Please retain the Git authors on cherry-pick or rebase. If folding the resolution into another commit, please include: Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3466:upstream-pr/3466'
git switch 'upstream-pr/3466'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3466'
git switch 'upstream-pr/3466'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3466'
git switch 'upstream-pr/3466'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3466'
git switch 'main'
git merge --squash 'upstream-pr/3466'
git switch 'main'
git merge --ff-only 'upstream-pr/3466'
git switch 'main'
git merge 'upstream-pr/3466'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Marvisak/VIctory!3466
No description provided.