Repository navigation
GPU: typed buffer views of 32-bit integer formats move their bits - #684
GamingRipperDoc wants to merge 1 commit into
Conversation
|
I independently checked the descriptor construction at base
The 96-bit UAV cases in the fixture show what the code submits to the device. Microsoft’s FL 12.0 format table lists typed UAVs as unavailable for all three Windows device execution and bitwise GPU readback remain unverified by this check. It used only synthetic descriptors. |
|
We independently observed the typed-UAV format mismatch on an RTX 4080 SUPER in the Series S opening. In a scoped test of GamingRipperDoc’s change, all three compute outputs originally received We adapted commit
Both runs used one binary and the same 3,100 starting save and cache files. We took a stationary screenshot 305 frames after the courtyard marker. Across two 64-interval windows per setting, pooled presentation went from 5.608 FPS off to 5.491 FPS on. The enabled run followed the control, so the 2.1% difference is a single-pair result. After a scripted camera turn, the two indoor frames had different framing. We compared 179,544 screen positions with similar depth and normals. Nonzero base color rose from 38,273 to 41,906 of those positions, or 2.02 percentage points. Some surfaces lost color, and this screen-space comparison cannot identify the same mesh at every pixel. A repeat from an identical indoor camera pose would help establish which materials benefit. These measurements come from a Codex-assisted local port and test harness. Upstream change |
Prepared with the help of Codex 6.2 Astra Max. (cherry picked from commit 9576cc2) fxceless#662. Conflict only in the tests: its test sits beside fxceless#684's in descriptor/host.rs.
|
On the 16-bit case this leaves out ("narrower integer formats ... need integer declarations in the translator"): #927 does that for the title's 16-bit accesses. They are The two don't overlap: this changes 32-bit integer buffer views everywhere; #927 only acts at d16 accesses and only on 16-bit formats. AI-assisted (Claude Code, Claude Opus 5.5). |
Translated shaders declare every typed buffer load and store as 32-bit float, so a view the title makes in R32_UINT (or another 32-bit integer format) converted the value on the way: a store of an integer's bits as a float wrote the integer the float rounds to. Make such views in the float format of the same width, which moves the bits unchanged and matches what the shader declares. GPU-based validation's UAV "format channel class" warnings (four, in three compute programs) are gone with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3467f1a to
ce1c419
Compare
…e boat); legacy multiply-add as RDNA 2 runs it; 32-bit integer typed views move bits; removal and world-frame instruments; placed-slot census; skin-bake sources and reaper off by default - At a device removal: the sixteen seconds before it, one row a second, and the pipelines first drawn with lately; the PC by the minute. - Host objects let go can be dropped by a thread of their own (VICTORY_REAPER, off); the frame log counts the world's frames apart. - Legacy multiply-add as RDNA 2 runs it: fused, sources flushed, zero-factor rule (pull request #1026). - Typed buffer views of 32-bit integer formats are made in the float format of the same width (pull request #684). - Placed texture slots counted by what they show every 5 s; textures with levels on demand that show no level; VICTORY_TILES_SMALL_WHEN_FULL_MB and VICTORY_RETIRE_LEAN (both off). - Skin-bake draws' own textures: VICTORY_BAKE_SOURCES=count|1 (off; pull request #1264, hand-ported onto the texture worker). - README: status and frame rate as measured.
What comes from upstream (previous merge base 988aa41): - VICTORY_HEAP_WORKER=1 (off): textures picked by index uploaded by a thread of their own (fork pull request fxceless#1007); needs VICTORY_LATE_WAIT (stage > 0, which the relay sets by default). - VICTORY_TABLE_STAGES (off): a draw's stages share the tables they make afresh. - VICTORY_HEAP_LOCKS (off): made slots found without the slots' lock (atomic made_now), kept resources in 64 locks. - VICTORY_BAKE_SOURCES=count|1 (off): skin-bake draws' own textures (fxceless#1264 hand-ported onto the texture worker). - VICTORY_REAPER (off): host objects let go dropped by a thread of their own. - VICTORY_TILES_SMALL_WHEN_FULL_MB and VICTORY_RETIRE_LEAN (both off). - Legacy multiply-add as RDNA 2 runs it (pull request fxceless#1026). - Typed views of 32-bit integer formats made in the float format of the same width (pull request fxceless#684). - Remapping time split in the frame log (unmap, map, commit, our notes). - The corner box shows the machine's load beside the frame rate (VICTORY_FPS_COUNTER=fps: the rate alone; =0: off). - A report at a device removal; placed-slot census; constant buffer view of no bytes stays one (fxceless#1260, one copy kept); diagnostics runs 301-309. Conflicts: - README.md: ours kept as is; upstream's added as README.upstream.md. .github/workflows/ci.yml unchanged from ours. - crates/victory-gpu/src/descriptor/host.rs: both. Our SlotSet and slot flags beside upstream's KEPT_PIECES/heap_locks(); HostHeap::new takes the 64 kept pieces and kept_one, sized count + extra, with next/free sized by our per-heap dynamic count (extra), not DYNAMIC. The lock-free made_now lookup goes in mirror_inner, before the records' lock (our mirror_with_made is called with the lock held), returning (view, None); made_now stores added to our keep-views return and after our make/keep branches. - crates/victory-gpu/src/draw.rs: upstream's bake-sources/worker pass setup, with our TEXTURE_SHORT short_room/since_short in front of it; our ShortOfRoom guard kept before upstream's List/Ahead view lookup. - crates/victory-hle/src/modules/xmem.rs: our title_memory_view call (section.handle) plus upstream's RemapNotesUs timing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream since 9c184b3: VICTORY_SETTLE_ROOM, VICTORY_PARALLEL_REFRESH, VICTORY_DISPATCH_SPREAD, the lookup cache's race fix (fxceless#1245), dynamic slots found across the search start, legacy multiply-add as RDNA 2 runs it (fxceless#1026), 32-bit integer typed views (fxceless#684), BC7 rotation, the corner box's load figures, VICTORY_HEAP_LOCKS / TABLE_STAGES / LIST_REUSE / HEAP_PASS_MARKED / CARD_SYNC_BATCH (off), ABSENT_ONCE and LIGHT_REFRESH (off), and its instruments. Resolutions: - watch.rs: upstream's file with fxceless#1067's BlockRuns kept (guard walk over the clean set's gaps, protected runs given back in one call) and upstream's noted-absent logic inside that walk; PUBLISHED bits cleared run by run. The local parking (VICTORY_VIEW_PARK, off) is dropped for upstream's ABSENT_ONCE / ABSENT_MS=told, which does the same. - descriptor/host.rs: one lock-free array (made_fast, fxceless#1117's path, on whatever the switch); upstream's made_now writes go to it, including the kept-view store; VICTORY_HEAP_LOCKS keeps its split keep locks. - indirect.rs: a record that can be spread across z is (upstream); one that cannot keeps the AMD wide x (VICTORY_INDIRECT_WIDE). - host.rs: a closed gather still goes to run slots (fxceless#1171); a record refused by VICTORY_GATHER_BY_COPY gets a pass of its own. - shadow.rs: fxceless#1245's order on our RwLock tables (fxceless#1068). - xmem.rs: remap timing on our persistent/temporary views (fxceless#872) and the skipped recommit (fxceless#1103). - policy: host.rs may be 640 KiB, as lower.rs (local).
|
Closing this: Thanks @AaronMacArthur for the RTX 4080 SUPER check and @tippythetaidum for the pointer to #927. No game data in this comment. AI-assisted (Claude Code). |
Typed buffer views of 32-bit integer formats: make them in the float format of the same width, so the translated shaders' float loads and stores move the bits unchanged.
Why
The translator declares every typed buffer access as 32-bit float (
victory_shaderemit/lower.rsannotates typed buffers as 4×f32). The title's descriptors are passed on with their own format, so a buffer the title views asR32_UINTis read and written through a float declaration over an integer view. D3D12 GPU-based validation flags each such dispatch (UAV resource format channel class differs from that expected by shader … Expected: FLOAT/UNORM/SNORM, In Descriptor: UINT). The console moves the bits, so a value stored this way may not come back as the integer the title wrote. The meshlet culling programs, for example, append packed meshlet numbers to anR32_UINTlist.What
One function in
crates/victory-gpu/src/descriptor/host.rs,bit_exact_format, mapsR32{,G32,G32B32,G32B32A32}_{UINT,SINT}to the_FLOATformat of the same width; every other format is left as it is.buffer_srvandbuffer_uavapply it before the element size is worked out (the width is the same, so offsets and counts don't change). It applies to buffer views only, where the format is the view's alone. Textures are untouched. A unit test covers the mapping and checks that element sizes match.Not covered: narrower integer formats (
R16_UINT,R8G8B8A8_UINT, …) have no float format that keeps their bits. Typed texture views can't be changed this way either, since a texture can only be viewed in formats its resource was created to allow. One texture case remains (below). It needs integer declarations in the translator instead.Tested
Windows 10 22H2 (19045), AMD RX 9070 XT (Adrenalin 32.0.32015.7029), Rust 1.98.1.
main310c6eb+ this commit):cargo test -p victory-gpu --lib --locked: 118 passed, 1 failed. The new test passed. The failure,pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws, fails the same way onmainwithout this commit, on Windows 10 without the Agility SDK runtime staged. Clippy reports no warnings in the changed lines, and rustfmt finds nothing to change there.VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_GBV=1on my test stack (this change plus other open PRs and local diagnostics), diag build, fresh cache and data folders, same machine:fc5e66f8f873d3bb,1f32b2302bce7ce4,ce684a9201818f3f)All the SRV warnings, before and after, come from one program (
6c4160eab4a573bb). It reads aTexture2D<float4>that the title views with a UINT format, which is the texture case above, so this change doesn't reach it. Both runs ended on their own while GPU-based validation was on, as other validation runs on this machine did. Neither lost the device.This doesn't fix the AMD page faults in #3 (the
_Prevculling programs fault with or without it).No game data used.
AI-assisted (Claude Code); I ran the checks above on my machine.
🤖 Generated with Claude Code