GPU: log initial states and clear format when texture creation fails #1627

Closed
AwsAli05 wants to merge 2 commits from upstream-pr/1628 into main
AwsAli05 commented 2026-11-24 19:57:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AwsAli05 on 2026-11-24T19:57:40Z.


Refs #1600. Thanks to the issue reporter for isolating the initial state and optimized-clear format as arguments worth capturing.

The existing "no host texture" warning prints the host resource description and HRESULT. Add the state requested by the title, the state passed to D3D12 after translation, and the optional format of the optimized clear value. Capturing these arguments separately lets the next affected run tell which combination D3D12 received. The call still uses the same texture description, state and clear value.

I used a temporary synthetic WARP probe to exercise three calls through the ordinary texture allocation path. An RGBA8 target requested in state 0x02000004 with a format-10 clear failed with E_INVALIDARG and logged host_state=0x4, title_state=0x2000004 and clear_format=Some(10). The same resource with a matching format-28 clear allocated successfully. A zero-sample descriptor without a clear failed with E_INVALIDARG and logged clear_format=None.

The GPU suite passed 50 tests with one ignored benchmark. Clippy passed for the GPU crate with all targets and features. No game files were used for the probe.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6590232374 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1628). Originally posted by [AwsAli05](https://github.com/AwsAli05) on 2026-11-24T19:57:40Z. --- Refs #1600. Thanks to the issue reporter for isolating the initial state and optimized-clear format as arguments worth capturing. The existing "no host texture" warning prints the host resource description and HRESULT. Add the state requested by the title, the state passed to D3D12 after translation, and the optional format of the optimized clear value. Capturing these arguments separately lets the next affected run tell which combination D3D12 received. The call still uses the same texture description, state and clear value. I used a temporary synthetic WARP probe to exercise three calls through the ordinary texture allocation path. An RGBA8 target requested in state 0x02000004 with a format-10 clear failed with E_INVALIDARG and logged host_state=0x4, title_state=0x2000004 and clear_format=Some(10). The same resource with a matching format-28 clear allocated successfully. A zero-sample descriptor without a clear failed with E_INVALIDARG and logged clear_format=None. The GPU suite passed 50 tests with one ignored benchmark. Clippy passed for the GPU crate with all targets and features. No game files were used for the probe.
catminou4 commented 2026-11-24 21:02:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:06:16Z.

Review: COMMENTED


Static review only: victory-gpu/victory-hle/apps are Windows-only (D3D12/windows_sys), so nothing here compiles or runs on macOS — please rely on the Windows CI leg.

Failed host texture creation now logs host_state (legal state after legal_for), title_state and clear_format — and clear_value[0] is indeed the format word (resource.rs sets value[0] = pc_format(value[0]) on the [u32; 5] clear value), so the field is correct. host_state is computed once before CreateCommittedResource instead of inline — no behavior change, clearer logs. Trivial and safe.

<!-- greyfinch-sync:Marvisak/VIctory:review:6046506407 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1628#pullrequestreview-6046506407). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T20:06:16Z. **Review:** COMMENTED --- Static review only: victory-gpu/victory-hle/apps are Windows-only (D3D12/windows_sys), so nothing here compiles or runs on macOS — please rely on the Windows CI leg. Failed host texture creation now logs `host_state` (legal state after `legal_for`), `title_state` and `clear_format` — and `clear_value[0]` is indeed the format word (resource.rs sets `value[0] = pc_format(value[0])` on the `[u32; 5]` clear value), so the field is correct. `host_state` is computed once before `CreateCommittedResource` instead of inline — no behavior change, clearer logs. Trivial and safe.
Marvisak commented 2026-11-25 02:06:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:32:37Z.


Automated triage for the maintainers.

Merge candidate. A small diagnostic for #1600. When texture creation fails, the "no host texture" warning in make_texture (crates/victory-gpu/src/resource.rs) now also logs the title's requested state, the host state actually passed (initial, after legal_for and the common-layout reset), and the format of the optimized clear value after pc_format. I checked that those are the values the CreateCommittedResource / CreateCommittedResource3 calls receive. Nothing else in the call changes.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149666927 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1628#issuecomment-7149666927). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:32:37Z. --- <!-- victory-triage v1 head=581bc4eec1cae1180fe7ff27b2612253ee011902 verdict=merge-candidate at=2026-11-25T06:26:49Z --> Automated triage for the maintainers. **Merge candidate.** A small diagnostic for #1600. When texture creation fails, the "no host texture" warning in `make_texture` (`crates/victory-gpu/src/resource.rs`) now also logs the title's requested state, the host state actually passed (`initial`, after `legal_for` and the common-layout reset), and the format of the optimized clear value after `pc_format`. I checked that those are the values the `CreateCommittedResource` / `CreateCommittedResource3` calls receive. Nothing else in the call changes. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 22:03:04 +00:00
Marvisak commented 2026-11-25 22:04:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:01:49Z.


Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because the question it was written for has been answered. Issue #1600 asked which argument the host refuses for two of the title's targets. Its comments now show the debug layer naming the unsupported unordered-access and render-target flags on those formats on NVIDIA, with the initial state and clear format being fine, so the fields logged here are not the cause. The fix belongs in texture creation (see #2286 and #2319).

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7175845912 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1628#issuecomment-7175845912). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T22:01:49Z. --- Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because the question it was written for has been answered. Issue #1600 asked which argument the host refuses for two of the title's targets. Its comments now show the debug layer naming the unsupported unordered-access and render-target flags on those formats on NVIDIA, with the initial state and clear format being fine, so the fields logged here are not the cause. The fix belongs in texture creation (see #2286 and #2319). If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

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!1627
No description provided.