Repository navigation
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
Conversation
… each console (port of DoubleGhosty/cool_fox d9f3ea6f8) The title's CPU code reads the ocean's 256x256 R32_FLOAT height map, which its wave passes write, and texback copies it into title memory in the console's layout. That texture is in SW_64KB_R_X, a pipe and bank XOR mode the tiler had no addressing for, so the copy back could not be tiled and the CPU read what was in that memory before. The logs of trustno1-coder#788, trustno1-coder#853 and trustno1-coder#859 each have "a texture copied back could not be tiled e=Unsupported"; the warning does not say for which texture. victory-formats: Layout::configure_render_xor addresses that one layout (a 256x256 plane of 4-byte elements, one mip, a 64 KiB-aligned allocation) with addrlib's GFX10_SW_64K_R_X_1xaa_RBPLUS equations for the console's pipes and packers: Series S 8 and 4, Series X 32 and 8. victory-gpu: title_texture sets it for an R32_FLOAT texture at a 64 KiB-aligned address, by the console the title runs as. A texture whose layout still cannot be addressed is left alone before any copy is recorded, with one warning that names its size, format and swizzle. From DoubleGhosty/cool_fox d9f3ea6f8 ("Support the aligned water height texture readback for boat missions"). The test's digests come from XCL's independent GFX10 tiler.
|
I compared this PR’s actual
I also ran the For the live 4070 Ti SUPER report in #880, the 256×256 resource I traced was bound as the output of |
…o1-coder#881 trustno1-coder#881 skips the copy back of a texture whose layout the tiler cannot address, at the list, with a test on WARP. This change also returned no target for such a texture: the same skip twice, and trustno1-coder#881 came first. So title_texture only sets the XOR addressing now, and its test checks what it gives: the layout addressed or not, at the right place and size.
|
I tested the patch at 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 |
A 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 CI: clippy clean again in both builds (four findings since 9b712a6) #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.