Surfaces

An Ounce game's block linear surfaces use another GOB: bits 5 and 6 of a byte's offset in it are swapped, so x bit 4 goes to bit 6 and y bit 1 to bit 5, for every format (g_gob_native in gpu/texture/blocklinear.h). Eden's native_tiling does the same. With the Maxwell GOB, the game's ASTC and BC textures came out as a weave of 4x4 blocks, alternate block columns one block row off.

What found it: a RenderDoc capture (the runtime's renderdoc setting, run under XWayland with SDL_VIDEO_DRIVER=x11, because RenderDoc has no Wayland surfaces) and qrenderdoc --python to save each pass's targets and inputs. That showed the texture itself wrong before any draw. Then the texture's guest bytes, decoded off line with each order of the GOB's address bits, gave one order with clean block edges.

A game's program that makes a texture's levels from its first has seven image slots, one for each level. The game leaves the slots past the texture's last level empty: their handle is 0, and the header there is all zeros. The renderer binds an empty storage image there (vk_null_storage). Before, it skipped the whole dispatch. One game draws its kart's contact shadow as a box that samples a 128x128 texture array with trilinear filtering. Layer 0 is the kart's footprint, drawn into level 0 from a 256x256 texture, and this program writes levels 1 to 3. Without them the box read zeros at the title camera's distance and drew a dark square under the kart.

A memory pool that ends while results of the GPU over it are not in guest memory yet (render targets not written back, pending results: Renderer.gpu_holds) waits in nvnMemoryPoolFinalize until the GPU thread has made the pool's unmap, which lands them first (gmmu_later_wait, bounded at 5 s). The console's GPU wrote them into the storage as it ran, and a game may hand a pool's storage to other uses as soon as the pool has ended. Without the wait the unmap, made later on the GPU thread, landed a render target's old pixels over memory that one engine's allocator had given to its object hash tables in the meantime (a watchpoint on the tables' array caught the GPU thread's landing writing zeros there): the game looped for good in a hash chain. The same boot also stopped at a property its struct didn't have, at a different point from run to run, most runs at -O2; that is taken for the same overwrite, as it no longer happened in about 20 runs with the wait, but no write was caught for it. A pool with nothing of the GPU's over it ends at once, as a Switch device's always does: 60 of one boot's 72 pool ends waited, about 4 ms each.


Made from docs/platforms/nx/ounce.md at 69237645142c. GPL-3.0-or-later.