Repository navigation
gpu: packed 16-bit render targets are R8G8B8A8 where the GPU cannot render to them - #89
HenriqueSBueno wants to merge 2 commits into
Conversation
|
Confirmed the two allocation cases on an RTX 3060 Ti, Windows 10 22H2, NVIDIA 610.88. A synthetic hardware test of the patch created both 2560×1440 resources with the original flags and optimized clear values. Guest format 86 (flags 5) and 115 (flags 1) both became host format 28. Sampled-only textures retained their packed formats. One integration detail for transfers: a guest buffer footprint in either packed format still describes two bytes per pixel. Directly forwarding that footprint to a widened RGBA8 texture, or copying between a sampled-only packed texture and a widened render target, can record incompatible host copies. Resolves between widened targets also need the effective host format. In the downstream test we allowed transfers with matching representations and declined unsupported mixed transfers before recording barriers or marking the destination written. This was a native resource test. It did not run the title or establish an effect on the world hang. AI-assisted with Codex. |
|
Verified
AI-assisted. |
…ender to them AI-assisted (Claude Code)
85ea36d to
da580e4
Compare
|
Tested
No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent). |
…argets - Buffer-to-texture CopyTextureRegion: widen packed 16-bit (86/115) placed footprints to R8G8B8A8_UNORM and expand texels on the CPU at submission (packed <-> RGBA8 helpers and unit tests added for uploads and readbacks). - texture::upload: detile widened packed 16-bit textures into a tight 2-byte buffer before expanding rows into the 4-byte host staging footprint. - GPU-to-GPU CopyResource, CopyTextureRegion, and ResolveSubresource: skip mixed native-packed <-> widened copies once per format before barriers or host_written, and map resolve formats through target_format. - view_format: return None for typed widened targets so null view descriptions inherit the host resource dimension. AI-assisted (Claude Code)
|
Thanks for the reviews and the numbers on three more cards.
Checks on Windows 11, RTX 3080 (616.92): AI-assisted (Claude Code) |
|
I tested the packed texture fallback on a desktop RTX 5090 (621.24) and the integrated AMD Radeon GPU in the same PC. This builds on martingouv's note about one-bit alpha. The 5090 can't write formats 86 and 115 as typed UAVs, but the AMD GPU can. I compared the actual AMD writes against a widened RGBA8 shader running on the 5090. Rounding at each store and using the nearest expanded byte on the dependent read matched all 262,144 packed results across both formats. A different rule matched native format 86 render-target draws on the 5090. Overlapping triangles showed why converting only after a draw can still give wrong colors. For format 115 unblended draws, two inputs could become the same RTX byte but different native AMD packed values. I tried correcting the original shader output before storing it to RGBA8. That matched all 196,608 pixels across two random input sets and a rounding-boundary test. The ZIP has the shaders, a standalone GPU-to-packed-buffer readback prototype, raw logs and separate texture-layout patches. The patches apply to main at d2a4bae and PR #89 at 081afbd. All 17 standalone test programs passed locally. I haven't compiled the patched VIctory crate or tested gameplay. AI-assisted with Codex. VIctory-RTX5090-graphics-tests.zip Complete outputs folder — includes the DirectX test report, the project test results, and the graphics-test package linked above. |
…e GPU cannot render to them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested
This confirms the texture compatibility work on the real title path, but not a fix for #97. Only aggregate counts and error classes shared. AI-assisted (Kimi Code). |
|
Two corrections to my comment above.
What the measurement does say about @fuzeofficlal's case (an RTV-only 86 is widened without need): these are the only two textures the host refuses in my RTX 2080 world run.
So choosing by use (widen 86 only when it also needs the UAV, and 115 when it needs the RT) covers both refused textures. My log only names refused textures, so it can't say whether the title also makes an RTV-only 86. AI-assisted (Claude Code): the runs and log analysis were automated. The hardware, title copy and runs are the user's. |
|
Rebased and extended this work on top of current Summary of Changes
Verification Results
Branch compare link for review / cherry-pick: |
|
I verified the guest texture-to-buffer case raised above on a physical RTX 5070. The local integration uses this PR at I uploaded a nonuniform 4×4 array of 16-bit texels and copied it back through the guest The integration checks the guest source format against the packed destination and reads the actual host texture format. D3D12 gets an RGBA8 staging footprint. After the queue completes, the existing |
# Conflicts: # crates/victory-gpu/src/list.rs
…izing Marvisak#89 (open since before this PR) already makes packed 16-bit render targets R8G8B8A8 where the host cannot render to them or store to them, and converts copies instead of skipping them. In the title on an RTX 3060 Ti, a tree with Marvisak#89 creates both 2560x1440 targets (no `no host texture`). This PR now only sizes the capped view heap to the host's limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent integration test of both packed-target commits through Why this was tested Integration and tests
Limits AI assistance: OpenAI Codex resolved the integration conflicts, ran checks and drafted this report at the account owner's request. Exact runtime model identifier unavailable. Runtime-measurement correction: A subsequent idle-GPU check, after the title exited, found a competing local CUDA workload with GPU utilization near 98% and about 31 GB of the 32 GB VRAM occupied. The game runs above were not performed with GPU resources isolated. Their FPS, presentation counts and memory/latency observations must not be treated as clean performance benchmarks or evidence of a project-specific stall. The reported test pass/fail counts are the actual observed results; the explicit texture-format/debug-layer errors and local frame-content observations are still observations, but causality of remaining slowdowns/crashes is not established. A clean rerun is needed. No details of the unrelated workload are included. |
… PresentX planes Merges https://github.com/fxceless/victory-fork (main, 4e17478) into this fork. The two rewrote the same GPU and shader code (20 files, 80 conflicts), so the merged tree is fxceless's tree, with two additions it does not have, re-applied on top: - The FidelityFX upscaler answered by AMD's PC FidelityFX SDK when VICTORY_FFX_DIR is set (the pc-fsr branch, f96ad82): applied unchanged. - PR Marvisak#211's multi-plane PresentX compositing (Series S menus): several planes are composited in a list of their own; a single plane keeps fxceless's present path, including presents sent ahead. Dropped in favour of fxceless's own implementations: this fork's lazy host textures and VRAM report, bounds root constants, rectangle geometry shader, mesh index/position changes, the diagnostics switches added with them, and PRs Marvisak#89, Marvisak#492 and Marvisak#578 (fxceless has its own target formats and wave64 handling; Marvisak#578 refused every wave64 compute program on 32-lane GPUs). That work stays reachable on the try/pr-211-578 branch at 575a4ee. Builds with and without the diagnostics feature; the workspace tests pass. Not run in the game yet. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
Marvisak#168, Marvisak#89) Under `VICTORY_LATE_WAIT` and `VICTORY_RELAY`, `Shadow::stale_under_writes` and `Shadow::merge_under_writes` (`crates/victory-gpu/src/shadow.rs`) only iterated pages returned by the write-watch delta (`written`). Any page inside a pending shader `GpuWrite` range whose `copied` timestamp was still `0` (never copied into the host copy yet) and that did not appear in `written` was silently skipped, leaving it zeroed on the GPU while `Shadow::update` also skipped the pending range. Mirror `Shadow::copy_stale` by extracting `stale_pages_in` and scanning every page in `[a, e)` for `copied == 0 || write > copied` in both `stale_under_writes` and `merge_under_writes`. Add `shadow::relay_tests::stale_pages_include_uncopied_pages_absent_from_write_watch`.
What
On a GPU that can't render to the console's packed 16-bit colour formats, or can't write them as typed UAVs, render-target and unordered-access textures in those formats are made as R8G8B8A8_UNORM. The formats are B5G5R5A1_UNORM (86) and B4G4R4A4_UNORM (115). Textures that are only sampled keep their format.
Why
On NVIDIA (RTX 3080, driver 616.92) the title asks for two 2560x1440 targets the driver refuses:
NVIDIA has no render-target support for B4G4R4A4 and no typed UAV for B5G5R5A1. AMD has both, so this doesn't show on an RX 6700 XT.
How
resource::target_formatstands the R8G8B8A8_UNORM format in for 86/115. It applies only whenCheckFeatureSupport(FORMAT_SUPPORT)lacksRENDER_TARGETorTYPED_UNORDERED_ACCESS_VIEW, asked once per format, so AMD keeps the native formats. Each channel keeps its value, with more precision.target_format, and so does its optimized clear value.target_format, so views, PSOs and resources agree.fits: a shader-resource or unordered-access view naming 86/115 on such a texture takes the texture's format.Tested
Windows 11, RTX 3080 (NVIDIA 616.92), i5-10400F:
cargo test -p victory-gpu: 39 pass.cargo clippy -p victory-gpu: clean.cargo xtask policy: ok.packed 16-bit render targets are R8G8B8A8_UNORM on this GPUfor format 86 and format 115, and there are nono host texturewarnings.AI-assisted (Claude Code)