Skip to content

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

Closed
AwsAli05 wants to merge 2 commits into
Marvisak:mainfrom
AwsAli05:gpu/log-texture-creation-parameters
Closed

AwsAli05 wants to merge 2 commits into
Marvisak:mainfrom
AwsAli05:gpu/log-texture-creation-parameters

Conversation

@AwsAli05

Copy link
Copy Markdown
Contributor

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 catminou4 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.

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.

nazmi added a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
"no host texture" alone does not say why the host refused one: the state
the title's maps to is the usual cause (a resource's flags forbid it), and
the clear value names a format the resource need not have. The fallback's
note now carries `initial` (what was asked for), `title_state` and the
clear value's format.

Source: PR Marvisak#1628 head f016efe
Author: Aws <aliaws123@outlook.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Adapted: the PR was written before make_texture took the
CreateCommittedResource3 fast path. Its host_state local is the current
`initial` (the fast path zeroes it only when it succeeded, so the fallback
still logs the state it passed), and the clear format is captured before
the value becomes the host pointer.

(cherry picked from commit 9bfb88f5b0cb7fbcca33c3621cfc94d468962d96)
nazmi added a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
Review workers over ~45 more PRs against the merged upstream tree.

Integrated: Marvisak#1394 (antisymmetric XUserCompare), Marvisak#1390 (A8_UNORM is not in
the R8 typeless family), Marvisak#1499 (deep 3D mips stay out of the thick tail,
plus a regression test the PR lacked), Marvisak#1366 (mesh stage I/O does not parse
VS inputs), Marvisak#1594 (the title's exit status reaches the shell), Marvisak#1299 (docs:
validator prerequisite), Marvisak#1515 (dialog commands before init), Marvisak#1424 (empty
submissions skip the lock), Marvisak#1144 (shader differential skips are reported),
Marvisak#1129 (64 MB pipeline-worker stacks), Marvisak#1564/Marvisak#1565/Marvisak#1566 (MakeResident,
Evict and SetStablePowerState succeed as the console's do), Marvisak#1250 (a zero
element count reads to the end of the buffer), Marvisak#1628 (texture-creation
failure logs its states).

Re-applied after the upstream merge dropped them: f32_to_half NaN and
ties-to-even (Marvisak#843), unique-temp library writes (Marvisak#1660),
VICTORY_PIPELINE_WORKERS (Marvisak#1728), VICTORY_MODE (Marvisak#1701).

Removed: the orphaned depth-bounds test file, whose implementation
(9a6d9e6) the merge dropped and which no module compiled.

Refused: Marvisak#1099 (writing 0 for an unpaired p1 interpolation computes wrong
values; two reviewers upstream and one here reached the same conclusion).
Duplicates: Marvisak#1217, Marvisak#529, Marvisak#531, Marvisak#590, Marvisak#1102, Marvisak#398, Marvisak#1150, Marvisak#1220.

Gate at efda2c5: fmt 0 differing, both Clippy gates 0 errors, policy 219
files, workspace 674 passed / 0 failed with the 10 documented pre-existing
GPU skips.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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

…ion-parameters

# Conflicts:
#	crates/victory-gpu/src/resource.rs
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 25, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 25, 2026
@Marvisak

Copy link
Copy Markdown
Owner

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.

@Marvisak Marvisak closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants