GPU: drop a texture's clear value the host cannot take #3065
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3065
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3065"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Halfect on GitHub · 2026-11-26 05:59 UTC · original
Halfect:fix/clear-value-target-flags→main· +36 −1 · 1 files · 1 commits · openWhat
victory-gpu'shost_descmasks a title texture's flags to the PC set (PC_FLAGS), butmake_textureforwarded the title's optimized clear value toCreateCommittedResource/CreateCommittedResource3unconditionally. PC D3D12 refuses a clear value when the flags name neitherALLOW_RENDER_TARGETnorALLOW_DEPTH_STENCIL— verified on this machine:E_INVALIDARG(0x80070057) with flags 0, success withALLOW_RENDER_TARGET— so such a texture got no host copy at all (a "no host texture" warning, then every use of it failed).Drop the clear value when the masked flags have neither use, keeping it for render targets and depth buffers as before.
Refs #1242 (
VIC-BT-022).Testing
resource::tests::a_clear_value_on_a_plain_texture_does_not_break_creation: a 64x64 R8G8B8A8_UNORM texture with flags 0 and a clear value. It fails on main (creation refused) and passes with the change. Skips cleanly when the test host has no D3D12 device.cargo test --locked -p victory-gpu --lib: 229 passed; the 3 failures (descriptor::host::tests::dynamic_slots_are_held_until_released,draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view,memory::tests::lists_share_a_table_and_copies_keep_their_views) fail identically on unmodified main on this machine (NVIDIA).cargo clippy --locked -p victory-gpu --lib --tests -- -D warnings: clean.cargo xtask policy: ok.Limitations
Verified on one Windows host; the rule the fix relies on is the D3D12 runtime's own parameter validation, not a driver quirk.
cargo fmtshows pre-existing differences with this toolchain version on untouched parts of the crate; the changed lines follow the file's style.No game data. AI-assisted (Kimi).
@Marvisak on GitHub · 2026-11-26 06:18 UTC · original
Automated triage for the maintainers.
Merge candidate.
make_texture(crates/victory-gpu/src/resource.rs) passed the title's optimized clear value to resource creation even when the host flags (masked toPC_FLAGSinhost_desc) allow neither render-target nor depth-stencil use. PC D3D12 refuses that withE_INVALIDARG, so the texture got no host copy. The PR keeps the clear value only whend.flags & (USES & !UNORDERED)(render target or depth) is set. Thedpassed in is the host description, with uses merged from other title textures at the same memory, so render targets and depth buffers are unaffected. A side effect: such textures now also qualify for the placed-resource path (clear_value.is_none()), which is fine. The regression test creates a 64x64 RGBA8 texture with flags 0 and a clear value.CI:
checkpassing.Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.