Files
NX2navi/runtime/nvn_tex.c
chrg6 79b36044b0 Compute texture layout sizes in 64 bits, so a garbled descriptor cannot wrap to a small size.
nvn_tex.c multiplied a level's width by its samples and its blocks by their bytes in 32 bits, and
nvn_tex_linear_stride did the same: a descriptor with a width past 2^30 (garbled, or not set up yet) wrapped to a small
size, and the texture got a small allocation for a large image. Block counts, row bytes and GOB counts are now 64-bit
(mip, blk, pick_tile and adj_tile take 64-bit sizes), and the linear stride saturates at 2^32 - 1 instead of wrapping.
Real textures lay out as before.

Checked: --probe-nvn-tex gains two cases (an RGBA8 texture 2^30 + 64 texels wide, and its linear stride). Before, the
first failed: 2,048 bytes against 2^35 + 2,048. After, all 135 cases pass, the 40 layout goldens of the original SDK
among them; --probe-nvn shows the same four failures as the baseline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:38:18 -05:00

10 KiB