Missing tree leaves (#35): nn::fs::DirectoryEntry type at 0x304, not 0x302 #436

Closed
evilmfkr wants to merge 1 commit from pr/dir-entry-type into main
evilmfkr commented 2026-11-08 01:30:28 +00:00 (Migrated from github.com)

nn::fs::DirectoryEntry is { char name[0x301]; pad[3]; s8 type at 0x304; pad[3]; s64 size at 0x308 }. ReadDirectory wrote the type byte at 0x302, so the game read 0 (directory) for every file. Its Foliage/NodeTreeShootLeaf listing (101 .flnt.zs files) came back empty, the leaf upload list in f_82c24db0 stayed at 0 and the leaf record table was never filled: trees had no canopies.

nn::fs::DirectoryEntry is { char name[0x301]; pad[3]; s8 type at 0x304; pad[3]; s64 size at 0x308 }. ReadDirectory wrote the type byte at 0x302, so the game read 0 (directory) for every file. Its Foliage/NodeTreeShootLeaf listing (101 .flnt.zs files) came back empty, the leaf upload list in f_82c24db0 stayed at 0 and the leaf record table was never filled: trees had no canopies.
duck-paradise commented 2026-11-08 01:51:23 +00:00 (Migrated from github.com)

Independent confirmation: I hit the same bug while tracking down missing foliage on an RX 9070 XT (Windows) and ended up with the identical change (0x302 → 0x304 in both ReadDirectory paths).

Some notes that may help:

  • It is not only the canopies. With the type at 0x302 every listed file reads as a directory, so both Foliage/NodeTreeShootBranch and Foliage/NodeTreeShootLeaf come back empty. The per-type table the foliage culling reads (the 1168-byte records at +0x49000 of its buffer, filled by f_82c24db0) then stays all zero from boot. Flower beds, bushes and pot plants were missing for the same reason, and they came back with this fix.
  • #203 (the courtyard planter drawing as a grey pattern) might have the same cause. It would be worth rechecking once this is merged.
  • This fix does not depend on the GPU. On AMD I also needed a separate change to storage-buffer tracking in the shader recompiler before the leaves drew, but that is a different issue.

+1 for merging this.

Independent confirmation: I hit the same bug while tracking down missing foliage on an RX 9070 XT (Windows) and ended up with the identical change (0x302 → 0x304 in both `ReadDirectory` paths). Some notes that may help: - It is not only the canopies. With the type at 0x302 every listed file reads as a directory, so both `Foliage/NodeTreeShootBranch` and `Foliage/NodeTreeShootLeaf` come back empty. The per-type table the foliage culling reads (the 1168-byte records at +0x49000 of its buffer, filled by f_82c24db0) then stays all zero from boot. Flower beds, bushes and pot plants were missing for the same reason, and they came back with this fix. - #203 (the courtyard planter drawing as a grey pattern) might have the same cause. It would be worth rechecking once this is merged. - This fix does not depend on the GPU. On AMD I also needed a separate change to storage-buffer tracking in the shader recompiler before the leaves drew, but that is a different issue. +1 for merging this.
Commenting is not possible because the repository is archived.
No description provided.