Texture read-back: the ocean's height map in SW_64KB_R_X is tiled for each console (port of DoubleGhosty/cool_fox d9f3ea6f8) #892
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!892
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-892"
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?
@kibagami-nc on GitHub · 2026-11-28 08:39 UTC · original
kibagami-nc:fix/water-height-readback-xor→main· +152 −11 · 2 files · 2 commits · merged 2026-11-28 19:39 UTCA port of DoubleGhosty/cool_fox d9f3ea6f8, "Support the aligned water height texture readback for boat missions": its addressing part. The finding and the code are DoubleGhosty's.
What happens
texbackcopies textures that the title's shaders write and its CPU code reads back into title memory, in the console's layout. By default it takes four kinds of the ocean's textures, among them 256x256R32_FLOAT. Its module doc says that without it, boats sank.DoubleGhosty found the ocean's height map in
SW_64KB_R_X, a pipe and bank XOR mode. The tiler had no addressing for any XOR mode ("shortcut: no addressing for the XOR modes"), so tiling such a copy back failed withUnsupported, and the CPU went on reading what was in that memory before.Three logs posted today on Series X show it: those of #788, #853 and #859 each have
a texture copied back could not be tiled e=Unsupported mip=0 slice=0. The warning is logged once and does not name the texture.The change
victory-formats(texture.rs):Layout::configure_render_xor(config)addresses that one layout: a 2D plane of 256x256 4-byte elements, one mip, single-sampled, in 64 KiB blocks of 128x128.GFX10_SW_64K_R_X_1xaa_RBPLUSequations for the console's pipes and packers: Series S 8 and 4, Series X 32 and 8. These are the two configurations XCL (gpu/texture.rs) found to match every texel of every mode against the console's own layout library.offsetand the copies use them. Every other XOR mode and MSAA still has no addressing; theshortcut:note now says so.victory-gpu(resource.rs):title_textureturns it on for anR32_FLOATtexture at a 64 KiB-aligned address, by the console the title runs as. XOR addresses assume the allocation's low 16 bits are zero.Not here: skipping the copy back of a layout that still cannot be addressed. DoubleGhosty's commit also did that, but #881 does it at the list, with a test on WARP, and came first. So this pull request leaves it to #881.
Tests
texture::tests::render_xor_water_matches_both_consoles_with_padded_rows, from the same commit:offsetfinds every texel;resource::tests::the_ocean_height_map_layout_is_addressed_at_a_64_kib_boundary:title_texturegives the layout at the texture's place and size, and the layout is addressable:SW_4KB_S: yes;SW_64KB_R_Xat a 64 KiB boundary: yes;SW_64KB_R_X256 bytes off: no;SW_64KB_S_X: no.cargo test -p victory-formats --lib --locked: 47 passed, 5 ignored.cargo test -p victory-gpu --lib --locked: 454 passed, 36 ignored.cargo check --workspace --all-targets --locked: builds.-D warnings, default and--all-features): nothing in the changed lines. It stops onmain's ownmanual_is_multiple_ofinshadow.rsanddescriptor.rs, fixed in #665. With that lint allowed, both builds are clean.Checked by others
Yoshi-233 compared
Layout::offsetata231183with a separately built AMD PAL addrlib (c5e8000). The surface was 256x256R32_FLOAT, one mip, one sample, base XOR zero, and every byte offset was compared:Yoshi-233 also ran this pull request with #881 on WARP. The only conflict was where both add a test to
resource.rs. With both, an alignedSW_64KB_R_Xtexture is copied back andSW_64KB_S_Xis skipped, so #881's test would takeSW_64KB_S_Xas its unsupported case.Yoshi-233 also notes, from #880, that a 256x256
R32_FLOATtexture of this layout was the output ofCS_ComputeTimestep, read byCS_MinTimestepReduce. A texture of this kind can serve more than the height map, so the effect on boats still needs its own look in the game.cxy0072019-sketch (RTX 5070 Ti, Series S) ran #932's build, which carries this change, on the same save and inputs with and without the XOR layout:
256x256 ocean-layout readback landed format=Some(DXGI_FORMAT(41)) bytes=262144;rejected e=Unsupported.The surface and the seabed showed in both runs, and the dark underwater waterline stayed.
#932 (wildheathen) builds on this pull request and addresses every XOR mode. If it lands, it contains this one.
Not run with the game. On a boat or in the water, a log with this change should no longer have
could not be tiledfor this kind. #826 (a physics glitch when swimming) is the kind of report it could bear on, but nobody has checked that yet.No game files, dumps or extracted data are included.
@Yoshi-233 on GitHub · 2026-11-28 08:45 UTC · original
I compared this PR’s actual
Layout::offsetata231183against a separately built AMD PAL addrlib (c5e800072a32f68b6ccc4422936d96167c6e0728). Each implementation exported every byte offset in row-major coordinate order; I compared the raw arrays element by element. The surface was 256×256 R32_FLOAT, one mip and one sample, with base XOR zero.d4556429b544c925ce798e86f5ab1d25I also ran the
victory-formatslibrary suite at this head: 47 passed, 5 ignored. This independently validates the two configured address equations.For the live 4070 Ti SUPER report in #880, the 256×256 resource I traced was bound as the output of
CS_ComputeTimestepand read byCS_MinTimestepReducein two separate runs. It matches this descriptor and alignment. A surface of this size and format can serve more than one purpose, so those bindings are useful when distinguishing the timestep texture from a CPU-read height map. The visual effect on boat buoyancy still needs its own observation.@sawetco on GitHub · 2026-11-28 15:02 UTC · original
I tested the patch at
7f6e2aaonv2026.11.27.10with #541 and #1111. My setup was an RTX 5070 on Windows 11 with NVIDIA 621.40, Series X at 1080p to 1440p, DLSS Quality and DLSS Frame Generation 2x.I went back as Jason to the small pool next to the bar near the mission marked B. Entering the pool still swept Jason away abruptly, like a strong current. This was the same spot as my earlier swimming report. Pool report in #826