GPU: log the missing D3D12 1.7 (no castable texture formats) #2003

Open
Calvix2k wants to merge 4 commits from upstream-pr/2005 into main
Calvix2k commented 2026-11-25 02:44:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T02:44:55Z.


Only the log; the placed-view test's expectation lives in #2251, and the cast device is now asked once per texture.

What

resource::make_texture makes a texture with its formats (castable) through CreateCommittedResource3, which needs ID3D12Device10 (D3D12 1.7). On a Windows 10 system runtime that interface is absent; the existing fallback then clears the castable list — correctly, since the old API cannot pass one — but silently, so every view in another format gets its own HostTexture and a copy at the read, and nothing in the log says why.

  • resource.rs: ask for ID3D12Device10 once per texture (one QueryInterface serving both the log and the creation, which used to ask twice) and, when it is absent while a castable list was wanted, log once at info.
  • No other change: the fallback, the address of the blocking list and the HostTexture behaviour are as in main.

Verification

  • Windows 10 19045 / RX 7800 XT: cargo test -p victory-gpu --features diagnostics --lib — the same single failure as unmodified main (draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view, the missing ID3D12Device10; #2251 derives its expectation). cargo clippy -p victory-gpu --all-targets -- -D warnings clean; cargo xtask policy clean.
  • Where ID3D12Device10 exists the log is not reached, and the creation path is unchanged.

No game data.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5484166737 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T02:44:55Z. --- Only the log; the placed-view test's expectation lives in #2251, and the cast device is now asked once per texture. ## What `resource::make_texture` makes a texture with its formats (`castable`) through `CreateCommittedResource3`, which needs `ID3D12Device10` (D3D12 1.7). On a Windows 10 system runtime that interface is absent; the existing fallback then clears the castable list — correctly, since the old API cannot pass one — but silently, so every view in another format gets its own `HostTexture` and a copy at the read, and nothing in the log says why. - `resource.rs`: ask for `ID3D12Device10` once per texture (one `QueryInterface` serving both the log and the creation, which used to ask twice) and, when it is absent while a castable list was wanted, log once at `info`. - No other change: the fallback, the address of the blocking list and the `HostTexture` behaviour are as in `main`. ## Verification - Windows 10 19045 / RX 7800 XT: `cargo test -p victory-gpu --features diagnostics --lib` — the same single failure as unmodified `main` (`draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view`, the missing `ID3D12Device10`; #2251 derives its expectation). `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean; `cargo xtask policy` clean. - Where `ID3D12Device10` exists the log is not reached, and the creation path is unchanged. No game data.
catminou4 commented 2026-11-25 02:48:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:48:45Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Logs missing D3D12 1.7 and skips the sharing test there — capability gating for older WARP/driver combos; good hardening.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051087989 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005#pullrequestreview-6051087989). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T02:48:45Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Logs missing D3D12 1.7 and skips the sharing test there — capability gating for older WARP/driver combos; good hardening.
AlanQiang0418 commented 2026-11-25 03:03:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AlanQiang0418 on 2026-11-25T02:48:50Z.


Could we keep both GPU readbacks running on hosts without Device10, and use the writer texture's accepted format list to decide whether round 0 should share? #1765 already has that assertion. The early return here also skips the BC1 round, which expects a copy on every host.

I tested cdc5986 on an RTX 5080 and WARP. Both passed normally. With Device10 still available, I simulated CreateCommittedResource3 returning E_INVALIDARG for the R32_UINT allocation only. Both runs then failed at round 0: one host texture (actual false, expected true). Dropping the early return and using let shared = shared && !a.castable.is_empty(); made both pass with the same injected failure, including the copy and texel assertions. The Intel report on #1765 describes a real adapter that refuses the list.

The log can also use the error from the existing interface query. That saves a second QueryInterface on each eligible texture and includes the HRESULT. I tested a one-file implementation with tracing enabled on both adapters. Four injected E_NOINTERFACE results in one process produced one INFO line with 0x80004002; normal runs produced zero.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151220318 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7151220318). Originally posted by [AlanQiang0418](https://github.com/AlanQiang0418) on 2026-11-25T02:48:50Z. --- Could we keep both GPU readbacks running on hosts without Device10, and use the writer texture's accepted format list to decide whether round 0 should share? [#1765](https://github.com/Marvisak/VIctory/pull/1765) already has that assertion. The early return here also skips the BC1 round, which expects a copy on every host. I tested `cdc5986` on an RTX 5080 and WARP. Both passed normally. With Device10 still available, I simulated `CreateCommittedResource3` returning `E_INVALIDARG` for the R32_UINT allocation only. Both runs then failed at `round 0: one host texture` (actual `false`, expected `true`). Dropping the early return and using `let shared = shared && !a.castable.is_empty();` made both pass with the same injected failure, including the copy and texel assertions. The Intel report on #1765 describes a real adapter that refuses the list. The log can also use the error from the existing interface query. That saves a second `QueryInterface` on each eligible texture and includes the HRESULT. I tested a [one-file implementation](https://github.com/AlanQiang0418/VIctory/commit/dd1825e) with tracing enabled on both adapters. Four injected `E_NOINTERFACE` results in one process produced one INFO line with `0x80004002`; normal runs produced zero.
upstream-sync changed title from [PR #2005] GPU: log the missing D3D12 1.7 and skip the sharing test there to [PR #2005] GPU: log the missing D3D12 1.7 (no castable texture formats) 2026-11-25 10:06:25 +00:00
Marvisak commented 2026-11-25 10:07:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:16:53Z.


Automated triage for the maintainers.

Merge candidate. This is a recommendation to look, not an approval. Re-reviewed at b674985, which merges cleanly into main.

resource::make_texture (crates/victory-gpu/src/resource.rs) now asks for ID3D12Device10 once per texture, only when there are castable formats, and keeps the QueryInterface error. The placed path (CreatePlacedResource2), the log and the committed path (CreateCommittedResource3) all use that one result. main can ask twice. The one-time info line now carries the HRESULT. Control flow otherwise matches main: the committed path runs exactly when main's !castable_formats.is_empty() && cast::<ID3D12Device10>().is_ok() would. The test expectations stay with #2251.

The earlier small point still stands, and it does not block: a placed texture made without ID3D12Device10 clears castable_formats before the log check, so the line first appears with a committed texture. Checking device10.is_none() right after the query would log on the first texture.

On your reply: confirmed. Dropping the test change leaves #2251 to own the expectations, and using the query's own error saves the second QueryInterface. CI: check passing on this head.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158118596 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7158118596). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T09:16:53Z. --- <!-- victory-triage v1 head=b674985d9acc54cca473888eca61e29cae381a84 verdict=merge-candidate at=2026-11-25T22:29:10Z --> Automated triage for the maintainers. **Merge candidate.** This is a recommendation to look, not an approval. Re-reviewed at `b674985`, which merges cleanly into `main`. `resource::make_texture` (`crates/victory-gpu/src/resource.rs`) now asks for `ID3D12Device10` once per texture, only when there are castable formats, and keeps the `QueryInterface` error. The placed path (`CreatePlacedResource2`), the log and the committed path (`CreateCommittedResource3`) all use that one result. `main` can ask twice. The one-time info line now carries the HRESULT. Control flow otherwise matches `main`: the committed path runs exactly when `main`'s `!castable_formats.is_empty() && cast::<ID3D12Device10>().is_ok()` would. The test expectations stay with #2251. The earlier small point still stands, and it does not block: a placed texture made without `ID3D12Device10` clears `castable_formats` before the log check, so the line first appears with a committed texture. Checking `device10.is_none()` right after the query would log on the first texture. On your reply: confirmed. Dropping the test change leaves #2251 to own the expectations, and using the query's own error saves the second `QueryInterface`. CI: `check` passing on this head. --- _Generated by [Claude Code](https://claude.ai/code)_
Calvix2k commented 2026-11-25 10:07:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T09:40:47Z.


Narrowed after seeing #2251 (@kotekompotek), which derives the placed-view test's expectation from the host instead of skipping it, and does the same for the paired-copy and heap-cap tests.

What is left here is only the missing log: when a castable format list would be used and the device has no ID3D12Device10 (D3D12 1.7 — a Windows 10 system runtime), say so once, because otherwise the fallback (every view in another format gets its own host texture and a copy) is invisible. Host::device10() is the check.

The placed-view test change from this branch is dropped in 83ee34f; #2251 owns the test expectations. Nothing conflicts between the two now.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158655290 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7158655290). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T09:40:47Z. --- Narrowed after seeing #2251 (@kotekompotek), which derives the placed-view test's expectation from the host instead of skipping it, and does the same for the paired-copy and heap-cap tests. What is left here is only the missing log: when a castable format list would be used and the device has no `ID3D12Device10` (D3D12 1.7 — a Windows 10 system runtime), say so once, because otherwise the fallback (every view in another format gets its own host texture and a copy) is invisible. `Host::device10()` is the check. The placed-view test change from this branch is dropped in `83ee34f`; #2251 owns the test expectations. Nothing conflicts between the two now.
Calvix2k commented 2026-11-25 19:06:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T18:33:51Z.


Rebased onto origin/main 13f91ca; the branch is mergeable again.

Conflicts were in host.rs (device10 next to main's new copies_in_video_memory) and resource.rs (main's crate::placement path). Resolution:

  • Host::device10 is gone, as the last commit intended: resource::make_texture asks ID3D12Device10 once per texture into a device10 local and uses it for the placement, the log and the committed creation. The placed path now reuses that query instead of asking again.
  • The log fires when a castable list was wanted and device10 is none, before the plain fallback.
  • The placed-view test stays as main has it (no skip), per 3e80d2c / #2251.

On Windows 10 19045 without the Agility runtime (no ID3D12Device10) + RX 7800 XT: cargo clippy -p victory-gpu --all-targets clean, cargo test -p victory-gpu --lib 194 passed, 1 failed, 1 ignored; the one failure is a_texture_written_in_one_format_reads_in_another_through_a_placed_view ("a placed texture"), the expectation #2251 owns, and it fails the same way on main here. The new info log appears once.

AI-assisted (DeepSeek V4.1).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171080666 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7171080666). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T18:33:51Z. --- Rebased onto `origin/main` `13f91ca`; the branch is mergeable again. Conflicts were in `host.rs` (`device10` next to main's new `copies_in_video_memory`) and `resource.rs` (main's `crate::placement` path). Resolution: - `Host::device10` is gone, as the last commit intended: `resource::make_texture` asks `ID3D12Device10` once per texture into a `device10` local and uses it for the placement, the log and the committed creation. The placed path now reuses that query instead of asking again. - The log fires when a castable list was wanted and `device10` is none, before the plain fallback. - The placed-view test stays as main has it (no skip), per `3e80d2c` / #2251. On Windows 10 19045 without the Agility runtime (no `ID3D12Device10`) + RX 7800 XT: `cargo clippy -p victory-gpu --all-targets` clean, `cargo test -p victory-gpu --lib` **194 passed, 1 failed, 1 ignored**; the one failure is `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` ("a placed texture"), the expectation #2251 owns, and it fails the same way on `main` here. The new info log appears once. AI-assisted (DeepSeek V4.1).
Calvix2k commented 2026-11-25 22:04:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T21:19:17Z.


Both points from @AlanQiang0418 are handled, one by the drop and one by b674985.

1. The early return and the BC1 round: gone. The test change was dropped in 83ee34f; #2251 owns the placed-view, paired-copy and heap-cap expectations. The diff here now touches only resource::make_texture: one ID3D12Device10 query per texture, plus one log. No test edits, so round 0/round 1 keep expecting a copy on every host, and the writer texture's accepted format list is not consulted here at all — that decision stays where #1765/#2251 put it.

2. The log uses the query's own error, not a second call. Noticed and adopted, thank you: the Result is kept instead of discarded with .ok(), so the message carries the HRESULT.

let mut device10_error = None;
let device10 = match (!castable_formats.is_empty())
    .then(|| host.device.cast::<ID3D12Device10>())
    .transpose()
{
    Ok(device) => device,
    Err(error) => { device10_error = Some(error); None }
};

and the one-time message matches on it:

ONCE.call_once(|| match &device10_error {
    Some(error) => tracing::info!(error = %error, "..."),
    None => tracing::info!("..."),
});

So an eligible texture costs exactly one QueryInterface whether or not ID3D12Device10 is there, and the line says why it is missing.

Verification (Windows 10 22H2 19045, RX 7800 XT, driver 32.0.32029.2010, origin/main 13f91ca rebased):

  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo test --locked -p victory-gpu --lib: 194 passed, 1 failed, 1 ignored. The one failure is draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view ("round 0: a placed texture"), the expectation #2251 owns; it fails the same way on main here.

I could not reproduce your injected E_INVALIDARG/E_NOINTERFACE setup, so the HRESULT in the line is the one your dd1825e describes rather than a second measurement of it.

AI-assisted (DeepSeek V4.1), no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7174918415 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7174918415). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T21:19:17Z. --- Both points from @AlanQiang0418 are handled, one by the drop and one by `b674985`. **1. The early return and the BC1 round: gone.** The test change was dropped in `83ee34f`; #2251 owns the placed-view, paired-copy and heap-cap expectations. The diff here now touches only `resource::make_texture`: one `ID3D12Device10` query per texture, plus one log. No test edits, so `round 0`/`round 1` keep expecting a copy on every host, and the writer texture's accepted format list is not consulted here at all — that decision stays where #1765/#2251 put it. **2. The log uses the query's own error, not a second call.** Noticed and adopted, thank you: the `Result` is kept instead of discarded with `.ok()`, so the message carries the HRESULT. ```rust let mut device10_error = None; let device10 = match (!castable_formats.is_empty()) .then(|| host.device.cast::<ID3D12Device10>()) .transpose() { Ok(device) => device, Err(error) => { device10_error = Some(error); None } }; ``` and the one-time message matches on it: ```rust ONCE.call_once(|| match &device10_error { Some(error) => tracing::info!(error = %error, "..."), None => tracing::info!("..."), }); ``` So an eligible texture costs exactly one `QueryInterface` whether or not `ID3D12Device10` is there, and the line says why it is missing. **Verification** (Windows 10 22H2 19045, RX 7800 XT, driver 32.0.32029.2010, `origin/main` `13f91ca` rebased): - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo test --locked -p victory-gpu --lib`: **194 passed, 1 failed, 1 ignored**. The one failure is `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view` ("round 0: a placed texture"), the expectation #2251 owns; it fails the same way on `main` here. I could not reproduce your injected `E_INVALIDARG`/`E_NOINTERFACE` setup, so the HRESULT in the line is the one your `dd1825e` describes rather than a second measurement of it. AI-assisted (DeepSeek V4.1), no game data.
fuzeofficlal commented 2026-11-26 20:10:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T20:10:35Z.

Review: APPROVED


Verified locally merged onto origin/main (63bcca43) at PR head b674985d (Windows 11 x64, NVIDIA RTX 5090 + Microsoft WARP, VICTORY_D3D12_DEBUG=1):

  • crates/victory-gpu/src/resource.rs (make_texture): consolidates ID3D12Device10 lookup to a single QueryInterface per eligible texture shared across placement, one-time info logging (carrying the QueryInterface error), and committed creation, without changing fallback behavior.
  • cargo xtask policy: 191 files ok.
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --all-features): 0 warnings.
  • cargo test --locked -p victory-gpu --features diagnostics --lib -- resource::tests:: draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view: 19/19 passed on both RTX 5090 and WARP with VICTORY_D3D12_DEBUG=1.
  • Extra synthetic tracing-subscriber probe (not committed): verified creating both placed (placement.is_some()) and committed (placement.is_none()) R8G8B8A8_UNORM textures on RTX 5090 and WARP keeps non-empty castable lists and emits 0 "no ID3D12Device10" log events.

Non-blocking note: echoing the triage remark, logging directly inside the Err(error) arm of the ID3D12Device10 query would also cover placed-only runs (before CreatePlacedResource clears castable_formats) and eliminate the unreachable None match arm on device10_error. Fine to merge as-is; synthetic tests only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6079991631 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005#pullrequestreview-6079991631). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T20:10:35Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`63bcca43`) at PR head `b674985d` (Windows 11 x64, NVIDIA RTX 5090 + Microsoft WARP, `VICTORY_D3D12_DEBUG=1`): - `crates/victory-gpu/src/resource.rs` (`make_texture`): consolidates `ID3D12Device10` lookup to a single `QueryInterface` per eligible texture shared across placement, one-time info logging (carrying the `QueryInterface` error), and committed creation, without changing fallback behavior. - `cargo xtask policy`: 191 files ok. - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`): 0 warnings. - `cargo test --locked -p victory-gpu --features diagnostics --lib -- resource::tests:: draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view`: 19/19 passed on both RTX 5090 and WARP with `VICTORY_D3D12_DEBUG=1`. - Extra synthetic tracing-subscriber probe (not committed): verified creating both placed (`placement.is_some()`) and committed (`placement.is_none()`) `R8G8B8A8_UNORM` textures on RTX 5090 and WARP keeps non-empty `castable` lists and emits 0 `"no ID3D12Device10"` log events. Non-blocking note: echoing the triage remark, logging directly inside the `Err(error)` arm of the `ID3D12Device10` query would also cover placed-only runs (before `CreatePlacedResource` clears `castable_formats`) and eliminate the unreachable `None` match arm on `device10_error`. Fine to merge as-is; synthetic tests only.
Dukestar69 commented 2026-11-26 23:08:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T23:08:35Z.

Review: APPROVED


LGTM — verified on RTX 5090 (Windows / D3D12) against origin/main (63bcca4).

  • Logging when D3D12 1.7 (ID3D12Device10 / castable texture formats) is unavailable improves diagnostics cleanly without changing behavior on supporting hosts.
  • cargo test -p victory-gpu --lib resource:: -- --test-threads=1: all passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6081357463 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2005#pullrequestreview-6081357463). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T23:08:35Z. **Review:** APPROVED --- LGTM — verified on RTX 5090 (Windows / D3D12) against `origin/main` (`63bcca4`). - Logging when D3D12 1.7 (`ID3D12Device10` / castable texture formats) is unavailable improves diagnostics cleanly without changing behavior on supporting hosts. - `cargo test -p victory-gpu --lib resource:: -- --test-threads=1`: all passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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/2005:upstream-pr/2005'
git switch 'upstream-pr/2005'

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/2005'
git switch 'upstream-pr/2005'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2005'
git switch 'upstream-pr/2005'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2005'
git switch 'main'
git merge --squash 'upstream-pr/2005'
git switch 'main'
git merge --ff-only 'upstream-pr/2005'
git switch 'main'
git merge 'upstream-pr/2005'
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!2003
No description provided.