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

Open
github-bot wants to merge 4 commits from github-bot/gh-2005 into main AGit
Owner

@⁠Calvix2k on GitHub · 2026-11-25 02:44 UTC · original
Calvix2k:codex/gpu-device10-1999 → main · +34 −4 · 1 files · 4 commits · open

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.

**@⁠Calvix2k** on GitHub · 2026-11-25 02:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/2005) `Calvix2k:codex/gpu-device10-1999` → `main` · +34 −4 · 1 files · 4 commits · open 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.
resource::make_texture makes a texture with its castable formats through
CreateCommittedResource3, which needs ID3D12Device10 (D3D12 1.7). On a
Windows 10 system runtime the interface is missing (E_NOINTERFACE), the
castable list is cleared silently, and every view in another format gets
its own host texture and a copy at the read. Say so once in the log:
without it a tester cannot tell why a window shows two textures per
memory (and why the placed-view test fails).

Host::device10() exposes the check, and the placed-view sharing test
skips with the reason when it is false, like the other capability skips:
what it checks cannot hold without the castable list.

Closes #1999.
The test's expectation is host-derived in #2251 (which covers the
memory paired-copy and heap-cap tests as well); this branch keeps only the
log for the missing D3D12 1.7 and `Host::device10`.
The log check and the castable-format creation each cast the device. Ask
once per texture and use the answer for both, which also drops the
`Host::device10` helper.
The one ID3D12Device10 query per texture now keeps its Result, so the
info log can name the HRESULT without asking a second time. Requested by
@AlanQiang0418 on #2005.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:51:21 +00:00
Author
Owner

@⁠AlanQiang0418 on GitHub · 2026-11-25 02:48 UTC · original

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.

**@⁠AlanQiang0418** on GitHub · 2026-11-25 02:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7151220318) 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://git.gtahub.st/github/Marvisak--VIctory/pulls/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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 09:16 UTC · original · edited 2026-11-25 22:24 UTC

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

**@⁠Marvisak** on GitHub · 2026-11-25 09:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7158118596) · edited 2026-11-25 22:24 UTC <!-- 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)_
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 09:40 UTC · original

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** on GitHub · 2026-11-25 09:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7158655290) 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.
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 18:33 UTC · original

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** on GitHub · 2026-11-25 18:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7171080666) 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).
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 21:19 UTC · original

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.

**@⁠Calvix2k** on GitHub · 2026-11-25 21:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2005#issuecomment-7174918415) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2005/head:github-bot/gh-2005'
git switch 'github-bot/gh-2005'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2005'
git switch 'github-bot/gh-2005'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2005'
git switch 'github-bot/gh-2005'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2005'
git switch 'main'
git merge --squash 'github-bot/gh-2005'
git switch 'main'
git merge --ff-only 'github-bot/gh-2005'
git switch 'main'
git merge 'github-bot/gh-2005'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2005
No description provided.