Skip to content

fix(gfx): scaled and format-changing texture copies are drawn, so Ocarina of Time's pause menus show the blurred scene behind them - #2160

Merged
ly05010419 merged 1 commit into
ly05010419:mainfrom
victormlourenco:fix/oot-menu-backdrop-scaled-copy
Nov 14, 2026
Merged

ly05010419 merged 1 commit into
ly05010419:mainfrom
victormlourenco:fix/oot-menu-backdrop-scaled-copy

Conversation

@victormlourenco

Copy link
Copy Markdown
Contributor

Problem

In Ocarina of Time the pause menus (for example the ocarina song menu) stood on a black background instead of the blurred scene, and the dark slots of songs not yet learned were invisible against it.

copy_t2t dropped every texture copy whose source and destination regions differ in size or format (RED_ONCE(33, …), then return). The menus build their backdrop from a copy of the 2560x1440 scene into a 1280x720 texture, so that texture was never written.

Fix

copy_t2t_draw (in games/totk/third_party/d2r_gfx/gfx/nvn/nvn_mtl.m) draws such a copy as one render pass per layer: the source region sampled into the destination region, nearest or (with NVN_COPY_FLAGS_LINEAR_FILTER_BIT) bilinear.

  • Float, unorm and sRGB 2D / 2D-array colour textures only. Integer, depth/stencil, compressed, multisampled and 3D copies are left as before and keep the red line.
  • A destination without render-target usage gets it through tex_upgrade_usage.
  • The pass follows the same encoder pattern as bloomq_capture (its own argument table, a barrier at the start, m4_end), and the parameters live in the frame arena.
  • TOTK_T2T_DRAW=0 turns it off for an A/B test.

Adapted from nxnative's copy_t2t_draw (MIT, commit e734ced7). The colour path only, rewritten for this backend; the row is in THIRD_PARTY_NOTICES.md.

Testing

  • Played on a Mac (Apple M4 Max, macOS 27.2): Ocarina of Time v131072, built with build_app.py and updated with update_runtime.py. Opened the ocarina song menu in Kokiri Forest: the blurred scene now shows behind the menu, and the slots of unlearned songs are visible. The game log has scaled / format-changing texture copy: first case 2560x1440 format 92 -> 1280x720 format 92.
  • python -m unittest discover -s tests: 1,376 pass. 5 modules (test_botw_import, test_dlc_import, test_game_containers, test_updates, test_xc3_shaders) do not load on this Mac because its Python lacks the cryptography package; that is unrelated to this change, which touches no Python.
  • Tears of the Kingdom and Breath of the Wild share this graphics layer and can now take the same path: not built or played for them. A copy they made that used to be dropped is now drawn.

…rina of Time's pause menus show the blurred scene behind them

copy_t2t dropped every texture copy whose source and destination regions differ
in size or format (RED_ONCE 33). Ocarina of Time's pause menus copy the
2560x1440 scene into a 1280x720 texture for their blurred backdrop; with that
copy dropped, the menus stood on black and the dark slots of songs not yet
learned were invisible against it.

copy_t2t_draw draws such a copy as one render pass per layer: the source region
sampled into the destination region, nearest or (LINEAR_FILTER) bilinear. Float,
unorm and sRGB 2D / 2D-array colour textures only; a destination without
render-target usage gets it through tex_upgrade_usage. Anything else keeps the
red line. TOTK_T2T_DRAW=0 turns it off for an A/B test. Adapted from
nxnative's copy_t2t_draw (MIT, commit e734ced7), listed in
THIRD_PARTY_NOTICES.md.
@ly05010419
ly05010419 merged commit d8e0e64 into ly05010419:main Nov 14, 2026
1 check passed

Copy link
Copy Markdown
Owner

已合并并推送。新增验证提交:0d3ead2e。

测试提取并执行实际 copy_t2t_draw 实现,使用 Metal 4 提交和独立 CPU 像素期望:16 个 GPU 用例、15,360 个通道比对全部通过,覆盖最近点/双线性、非零区域、未覆盖区域保留、mip、数组多层、RGBA/BGRA/sRGB/半精度目标及部分拒绝路径。集成后的 Mac/iOS 图形源编译通过。

本轮未重做 OOT 菜单或共享游戏的实际游玩;没有把合成 GPU 回归等同于游戏验收。谢谢贡献。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants