Repository navigation
修复神庙传送点黑色纹理与技能效果方块 - #3
ly05010419 merged 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Truncate height * 1.5 to whole GOB rows before selecting the automatic block height. This keeps the 160x160 BC3 shrine warp texture from reading padding as black texels while preserving explicit packaged layouts. Add 40 independent SDK layout goldens and addressing checks. Document historical TOTK 1.1.2 and fresh 1.4.3 validation on Apple M4 Pro. Host screenshots separately as fork release assets referenced by the PR. Co-authored-by: Codex <[email protected]>
Quantize D16 attachment and texture load-clear values into the same bins as fragment depth writes. A quarter-unit margin also avoids rounding below the intended integer during descriptor conversion. Keep other depth formats and fragment-based masked clears unchanged. Add a game-data-free Metal 3/4 regression covering 777 depth values, including all skill classification codes. Document the 1.1.2 Ultrahand and 1.4.3 Recall checks with separately hosted screenshot evidence. Co-authored-by: Codex <[email protected]>
927bdb9 to
3d90e41
Compare
…y05010419#3) Two rendering fixes from ly05010419#3, verified in this tree: - nvn_tex: NVN truncates height*1.5 to whole GOB rows before choosing the power of two; rounding up picked H3 for the 160x160 BC3 shrine-warp texture and the padding read as black. Explicit packaged layouts still win. - nvn_mtl/nvn_depth_clear: D16 clear values now go through the same 16-bit quantisation as fragment depth writes (0.5 cleared to 32767 while fragments wrote 32768, leaving the equal-test classification squares). Includes the two standalone probes (texture layout goldens and D16 clear) and their Makefile targets.
|
是的 我一直没时间 修复这个bug 非常感谢! @huahuahuahuahuahuahuahua |
|
Tested on an M4 Pro Mac (macOS 27.0.1, TOTK 1.4.3), combined with #12 and #13 on top of Results
One small fix needed: the probe targets break when Patch (git apply)diff --git a/games/totk/Makefile b/games/totk/Makefile
index 0e41637..0d5fd91 100644
--- a/games/totk/Makefile
+++ b/games/totk/Makefile
@@ -350,16 +350,20 @@ runtime-v143: build/totk-native-v143 build/pso_manifest.tsv
# Keep standalone rendering probe binaries outside the source checkout.
RENDER_PROBE_DIR ?= $(abspath $(CURDIR)/../../../TOTK_build/rendering-probes)
+# Escape spaces in make's target lists; recipes use the original quoted path.
+render_probe_empty :=
+render_probe_space := $(render_probe_empty) $(render_probe_empty)
+RENDER_PROBE_TARGET_DIR = $(subst $(render_probe_space),\$(render_probe_space),$(RENDER_PROBE_DIR))
.PHONY: probe-texture-auto-layout
-$(RENDER_PROBE_DIR)/texture-auto-layout-probe: tests/texture_auto_layout/probe.c third_party/d2r_gfx/gfx/nvn/nvn_tex.c third_party/d2r_gfx/gfx/nvn/nvn_tex.h third_party/d2r_gfx/gfx/tex/nvn_deswizzle.c
+$(RENDER_PROBE_TARGET_DIR)/texture-auto-layout-probe: tests/texture_auto_layout/probe.c third_party/d2r_gfx/gfx/nvn/nvn_tex.c third_party/d2r_gfx/gfx/nvn/nvn_tex.h third_party/d2r_gfx/gfx/tex/nvn_deswizzle.c
@mkdir -p "$(RENDER_PROBE_DIR)"
xcrun clang -std=c11 -O2 -Wall -Wextra -Werror -Ithird_party/d2r_gfx/gfx/nvn -Ithird_party/d2r_gfx/gfx/tex tests/texture_auto_layout/probe.c third_party/d2r_gfx/gfx/nvn/nvn_tex.c third_party/d2r_gfx/gfx/tex/nvn_deswizzle.c -o "$@"
-probe-texture-auto-layout: $(RENDER_PROBE_DIR)/texture-auto-layout-probe
+probe-texture-auto-layout: $(RENDER_PROBE_TARGET_DIR)/texture-auto-layout-probe
"$(RENDER_PROBE_DIR)/texture-auto-layout-probe"
.PHONY: probe-depth16-clear
-$(RENDER_PROBE_DIR)/depth16-clear-probe: tests/depth16_clear/probe.m third_party/d2r_gfx/gfx/nvn/nvn_depth_clear.h
+$(RENDER_PROBE_TARGET_DIR)/depth16-clear-probe: tests/depth16_clear/probe.m third_party/d2r_gfx/gfx/nvn/nvn_depth_clear.h
@mkdir -p "$(RENDER_PROBE_DIR)"
xcrun clang -std=c11 -O2 -Wall -Wextra -Werror -fobjc-arc -Ithird_party/d2r_gfx/gfx/nvn tests/depth16_clear/probe.m -framework Metal -framework Foundation -o "$@"
-probe-depth16-clear: $(RENDER_PROBE_DIR)/depth16-clear-probe
+probe-depth16-clear: $(RENDER_PROBE_TARGET_DIR)/depth16-clear-probe
$(GAME_SLOT_RUN) "$(RENDER_PROBE_DIR)/depth16-clear-probe"
diff --git a/tests/test_render_probe_paths.py b/tests/test_render_probe_paths.py
new file mode 100644
index 0000000..9ef7811
--- /dev/null
+++ b/tests/test_render_probe_paths.py
@@ -0,0 +1,35 @@
+"""Standalone rendering probes must accept external output paths with spaces."""
+from pathlib import Path
+import shlex
+import shutil
+import subprocess
+import tempfile
+import unittest
+
+
+ROOT = Path(__file__).resolve().parents[1]
+
+
+@unittest.skipUnless(shutil.which('make'), 'requires make')
+class RenderProbePaths(unittest.TestCase):
+ def test_external_output_path_with_spaces(self):
+ with tempfile.TemporaryDirectory() as folder:
+ output = Path(folder) / 'probe output'
+ result = subprocess.run(
+ ['make', '-n', '-C', str(ROOT / 'games/totk'),
+ f'RENDER_PROBE_DIR={output}',
+ 'probe-texture-auto-layout', 'probe-depth16-clear'],
+ capture_output=True, text=True, check=True)
+ self.assertNotIn('overriding', result.stderr)
+ commands = [shlex.split(line) for line in result.stdout.splitlines()
+ if line.startswith('xcrun clang ')]
+ self.assertEqual(len(commands), 2)
+ self.assertEqual(
+ [command[command.index('-o') + 1] for command in commands],
+ [str(output / name) for name in
+ ('texture-auto-layout-probe', 'depth16-clear-probe')])
+ self.assertFalse(output.exists(), 'dry run must not create build output')
+
+
+if __name__ == '__main__':
+ unittest.main()中文摘要:在 macOS 27.0.1 / 1.4.3 上测试通过。纹理布局回归(40 例)和 D16 GPU 探针(Metal 3/4 各 777 个深度值,旧代码 292 个不一致,修复后为 0)均确认修复有效。唯一问题: |
…lears) Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # games/totk/Makefile
神庙传送点的蓝色纹理会出现半边黑块;使用究极手/倒转等技能时,背景会暴露规则的分类方块。本 PR 分两个独立 commit 修正 NVN 自动纹理布局和 D16 清除量化,附上真实游戏修复前后截图。截图保存在用户 fork 的独立 Release 附件中,不进入代码提交。
修改内容
height_in_blocks * 1.5 / 8按 NVN SDK 的规则截断。160×160 BC3-sRGB 传送点纹理应使用 H2,原来的向上取整会选择 H3,把填充区读成黑色。两种布局的总分配大小均为 57,344 字节,因此单查大小发现不了问题。显式 packaged layout 的优先级保持不变。0.5load-clear 得到 32767,片元写入得到 32768,EQUAL 分类测试因此留下方块。修复将清除值置于两种转换共同的量化区间,并留出四分之一单位余量。其他深度格式、片元执行的 masked clear 保持原行为。修复前后:TOTK 1.4.3
测试基于 Apple M4 Pro、macOS Metal 4,以及上游
41e1e0c。两组运行时使用相同的原始 1.4.3 存档副本、相同位置和镜头输入,画质沿用上游设置。两组只共享本机启动必需的地址布局兼容修复,该修复不在本 PR 中;没有加入 2K/阴影增强、手柄修改或 Smoke-Free Hyrule。两组均关闭全量启动预热、按需编译目标场景着色器。本轮用于画面对照,不作为性能测试;截图中的游戏时间和天气动画略有差异。
神庙传送点
修复前,蓝色纹理左半边被黑色区域覆盖;修复后,蓝色图案完整显示。
技能分类方块
本轮 1.4.3 实机复测使用倒转:修复前地面和远处背景出现规则矩形块;修复后,技能分类效果连续,矩形块消失。
验证
提交拆分
Fix automatic texture block-height roundingMatch D16 load clears to fragment depth quantization两个 commit 使用
huahua <[email protected]>,均附带 Codex 协作署名。没有提交游戏二进制、解包素材、存档、密钥或本机启动兼容补丁。