Repository navigation
GPU: ignore clear values on non-target textures and avoid caching failed host textures in PLACED_TEXTURES - #1422
Conversation
|
Interaction note: the VIC-BT-027 half of this PR matches the The VIC-BT-022 half is only in this PR and looks right. The check runs after AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090. |
|
Partial overlap: #1353 also stops Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current
I didn't test with game data. Tested locally with an AI-assisted script (Claude Code); I checked the results before posting. |
|
Automated triage for the maintainers. Needs work. The clear-value half looks right. In The To move forward, either drop the CI ( Generated by Claude Code |
…led host textures in PLACED_TEXTURES AI-authored and verified by Gemini 4 Neon (High Mode) — zero game data used. Fixes VIC-BT-022 and VIC-BT-027 from Marvisak#1242 in `crates/victory-gpu/src/resource.rs`: - `host_texture()`: only forwards `pOptimizedClearValue` when `ALLOW_RENDER_TARGET` (1) or `ALLOW_DEPTH_STENCIL` (2) is set, as required by D3D12 `CreateCommittedResource`. - `texture_at()`: releases `out` and returns `None` without inserting into `PLACED_TEXTURES` when `resource(out).host.is_none()`, preventing both a leaked `Resource` allocation and subsequent `texture_at` calls from returning a cached `Some(r)` with `host == None`. - Adds `non_target_texture_ignores_clear_value_and_placed_cache_skips_failures` verifying both fixes on the real D3D12 device.
b70f51a to
4e3e669
Compare
|
I tested the clear-value half separately in response to the review. 14f1028 is a fast-forward from your exact HEAD The same synthetic Windows/WARP test calls The fork commit passed 199 GPU tests with one ignored. Its clean merge with Please retain the Git author if you cherry-pick the follow-up. If you fold the test or other changes from this commit into yours, please include: Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com AI-assisted with Codex. Synthetic resources only. |
Summary
Fixes two resource-creation bugs tracked in #1242 (
VIC-BT-022andVIC-BT-027) incrates/victory-gpu/src/resource.rs:Optimized clear value on non-target textures (
VIC-BT-022):CreateCommittedResourcerejects a non-nullpOptimizedClearValueunlessD3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGETorD3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCILis set.host_texture()now ignoresclearwheneverd.flags & (1 | 2) == 0.Failed host textures cached in
PLACED_TEXTURES(VIC-BT-027):texture_at()previously insertedoutintoPLACED_TEXTURESbefore checkingresource(out).host.is_some(). If host texture creation failed, the first call returnedNonewhile leaking theResourcebox, and every subsequent lookup for that(address, desc)returnedSome(r)withhost == None.texture_at()now checksresource(out).host.is_none()first, releasesoutviaobject::release_boxed::<Resource>(out), and returnsNonewithout poisoningPLACED_TEXTURES.Verification
Tested locally on Windows 11 with NVIDIA GeForce RTX 3060 Ti (
Driver 32.0.16.1656), Rust1.98.1MSVC:cargo clippy --workspace --all-targets --locked -- -D warnings— 0 warningscargo clippy --workspace --all-targets --all-features --locked -- -D warnings— 0 warningscargo test -p victory-gpu --all-features --locked— 54 passed, 0 failed, 1 ignored (includingnon_target_texture_ignores_clear_value_and_placed_cache_skips_failureson RTX 3060 Ti)cargo xtask policy— 154 files ok