比较提交

...
共修改 27 个文件,包含 1011 行新增和 120 行删除

没有与搜索条件相匹配的文件

+16
查看文件
@@ -0,0 +1,16 @@
# 大鱼调色 1.21.0(114)
- GPU 管线在工具首次使用时准备。未调整的独立效果可跳过通用调色和查找纹理,中性画面保留透明度、负值和超白。
- 无蒙版的 CST 合并两次全帧处理。示波器取样与最终输出共用 GPU 提交,保留暂停帧缓存。
- 检查器减少重复读参和布局更新,连续修改参数时减少宿主往返。
Apple Silicon,macOS 14.6 或更高版本。安装前保存并退出 Final Cut Pro 和 Motion。正式安装版通过 1050 项原生检查,包含 21 组独立 CST 对照。Final Cut Pro 12.4 实测播放、混合滑杆、复位和四种示波器。
| 项目 | 内容 |
| --- | --- |
| 实际编译提交 | `90e512aabe72fff30046b4bf18d6a35f91c0c113` |
| 安装包 | `大鱼调色-1.21.0.pkg` |
| 字节数 | 44508770 |
| SHA-256 | `ec1a57f23bf369d7a7841848d71d8ab78a7c229cbb5abe1c502e9964f87dbbcb` |
| APP 公证 | `505ed5a4-7b32-49a2-8eef-70c7757a98b4` |
| PKG 公证 | `29d5f921-6cd4-48a4-856a-2632f9a85e2b` |
+12
查看文件
@@ -1,3 +1,15 @@
# 2026-11-08 蜘蛛盘矢量示波器 1.20.2(113)
远程 `https://dayu.media/git/dayu/dayu-color.git`,分支 `main`。实际编译提交 `046411ba8b2c2bf8549601b2e5a080fd9dccd31b`,发行标签 `v1.20.2-spider-scope-20261108` 指向 `bc9021271d5e4992a6a63011e4ff197812029ab3`。独立远端克隆分别核对 798 与 802 个跟踪文件,Git 完整性通过,无 LFS 指针或子模块,发行标签与编译节点的构建输入一致。[恢复记录](verification/Recovery1.20.2.json)
恢复 Git 登录后克隆仓库,用 `git switch --detach <完整编译提交>` 还原工程。Xcode 27.1、FxPlug SDK 4.3.5、Apple Silicon、macOS 14.6+ 与锁定的 ColorManagement 依赖。使用 `tools/deliver.py` 构建、签名、公证及正式安装,完成 FCP 验收后输入 complete。主 ID `com.dayu.color`、服务 `com.dayu.color.XPC`、团队 B3W25FX5H5,唯一正式安装 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。证书、私钥与公证凭据独立恢复。
APP 公证 `e8c27c08-a78e-4be2-9adf-235e7bfad1f6` Accepted,1002 项正式安装检查通过,FCP 12.4 已在同一实片帧核对网格提亮及两处肤色线方向。安装包用 `Packaging/build_pkg.py` 从已验证的正式 APP 生成,公证 `1a6834df-840f-47da-9ee8-be6a0a808fee` Accepted,20 项展开验包、192 条载荷权限及票据通过。本机正式 APP 独立安装,验收未再次执行 PKG 安装脚本。[正式安装](verification/Delivery1.20.2.json) · [FCP 实看](verification/HostSpiderScope1.20.2.json) · [验包](verification/Package1.20.2.json)
Release **413** 保存安装包附件 **59**,大小 44505420 字节,SHA-256 `8edd792c6a9be629263baee68c4c3e7b67221ffd1e995bd8c9ab1f753eefd2b4`。草稿附件及发布后附件均完整下载验证。[Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.20.2-spider-scope-20261108) · [安装包下载](https://dayu.media/git/dayu/dayu-color/releases/download/v1.20.2-spider-scope-20261108/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.20.2.pkg) · [发行记录](verification/Release1.20.2.json) · [开发交接](开发交接.md)
---
# 2026-11-06 默认整合效果预览修复 1.19.1(110)
编译节点 `3642a1dba6cbbc4423bd6928944e0e95d76d9cfa` 已保存于 `https://dayu.media/git/dayu/dayu-color.git` 的 main。独立 HTTPS 克隆、分离检出与 778 个跟踪文件逐字节核对及 Git 完整性通过;无 LFS/子模块,未重复第三方冷构建。使用原 Xcode 27.1、FxPlug SDK 4.3.5、Release 和已有 ColorManagement 锁定依赖;`tools/deliver.py` 负责固定路径交付。签名、公证凭据不在仓库。
+19
查看文件
@@ -0,0 +1,19 @@
{
"version": "1.20.2",
"build": 113,
"formalApp": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"formalPackage": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.20.2.pkg",
"registeredPaths": [
" com.dayu.color.XPC(1.1)\t35786B49-0554-4495-8E95-47C2CE9ADB64\t2026-11-08 07:38:01 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit"
],
"removedVerifiedTaskCopies": [
"/Volumes/备份/大鱼调色/发行包/大鱼调色-1.20.0.pkg",
"/Volumes/备份/大鱼调色/发行包/大鱼调色-1.20.1.pkg",
"/Volumes/备份/大鱼调色-1.20.2.pkg",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/spider-scope-1.20.0/1.20.0 蜘蛛盘验收.fcpxml"
],
"buildAppRemoved": true,
"notaryZipRemoved": true,
"temporaryRecoveryClonesRemoved": true,
"scope": "仅本轮生成的产物和本产品正式路径"
}
+70
查看文件
@@ -0,0 +1,70 @@
{
"status": "verified",
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.21.0",
"build": "114",
"team": "B3W25FX5H5",
"notaryID": "505ed5a4-7b32-49a2-8eef-70c7757a98b4",
"notaryStatus": "Accepted",
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
"sourceCommit": "90e512aabe72fff30046b4bf18d6a35f91c0c113",
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
"templateSHA256": "48d9ff4883cf189ae0a54b5cf412a898beb97b38d29d6cbc745d6cfa613dce60",
"installedTemplateSHA256": {
"大鱼调色/大鱼调色.moef": "48d9ff4883cf189ae0a54b5cf412a898beb97b38d29d6cbc745d6cfa613dce60",
"大鱼调色/large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"大鱼调色/small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a",
"一级调色/一级调色.moef": "e4612f58eee5bf07a0a44cc5f6d65f9ca207b7f6946da938ed05f7d254ca7924",
"一级调色/large.png": "b9b990a46f3fd9b6974a1aba1a3e9bff11a287fd1615d4cd0f9e7393c302631b",
"一级调色/small.png": "77b36c042fb82219651e5bd22c1057b644c06a528a8962d4afecdcb8cab52635",
"蜘蛛盘校色仪/蜘蛛盘校色仪.moef": "68e91d3747a119e684f659093cb520a7fbd495336e8a1552316e52031e975ad5",
"蜘蛛盘校色仪/large.png": "52de21d5fc598fda331cd472b937cf4aaf69a09c80d49e7b168ac7804e9cd040",
"蜘蛛盘校色仪/small.png": "ea9b69d12948c5cd5f6acd9d000822d9fff6df3beec9dd278077a8ab66d455cd",
"基础调整/基础调整.moef": "ca6a584dd168990870fa774df8ba3fcfce5ad2e8de4d28bd656057fdaa1dbdca",
"基础调整/large.png": "a25e2b5ed50628ebe77220719528d14f21c25b5eecf37a5d60f211d2179ece43",
"基础调整/small.png": "3da91ae3461b882f5e1a557b4191d9aedaa6d329da70999eb7f26cbfb63a057f",
"肤色保护/肤色保护.moef": "06fdf5964f487a7cca3d6dce6e68013d3c0ba5b5c73c4bb392c7b58f5d916212",
"肤色保护/large.png": "f124e8f3d93c2be76ba26ba06d8b9c0b42e2c10dcb6300ae6ee7b7d7c7eb3025",
"肤色保护/small.png": "51fe525e67903101920a994d3540f368780d3aa9c0e54ebdb847871c82d81562",
"风格 LUT/风格 LUT.moef": "595f722d3ac99555d4e22611907b6273a3fb36fea59b8949be58eb1f7d319501",
"风格 LUT/large.png": "a9a4b48885752282535ec3ec2ffbe19bcd27af7132337e4a4ad3d104a2082692",
"风格 LUT/small.png": "9ae76ba957b1e94a5a03a600140f59e98861917d13da9124082810c509400e36",
"HSL/HSL.moef": "97bcbf240f86f485299c298d90f9339aa87a2751cef475e3d6a1637144d4ab13",
"HSL/large.png": "eaa2e7b025dc59416fddb8de8b9c56f0a7d34ba70facd7aa45cfb84660f7da78",
"HSL/small.png": "3a54428bc6821e75935aa1be0f149aac6e6ce05fcc059b7f0e90ceef9a41981e",
"曲线/曲线.moef": "3f235de32384a3b268982609583702d28470ed91c756f1b13947454f22bf3fc0",
"曲线/large.png": "273899eb6aa60fc0f7c8d41cc0e1f5a15b4c88a8803c00020a085ea874160870",
"曲线/small.png": "c17a2343b076650344b1c53ce92acf32f7696d66e32bda2d156996d4e3b834f5",
"颜色分级/颜色分级.moef": "c49877ada4fa0ac49fa497b62f3a3e09bfe15f0d73b352bdfbeb0a9a2b7b1aad",
"颜色分级/large.png": "f9afe6c3a76080a2a7c7ea98f24e62a74ab2e6fd8b4ad16ba9eb6065fef5d2ed",
"颜色分级/small.png": "9e9d7759f829d25a01a77422c989949b02ad34de81013f6b91505c4a3d1397e9",
"三原色/三原色.moef": "6015ecc2cc89116b05d601df920ae674bad9ad4c6e7bad1f0eac889e08cda60d",
"三原色/large.png": "bf7bfc893e294fc38c0f97e5594b6ba6e5c7126b9aae643754c89647e8bd5a1f",
"三原色/small.png": "2e28988e6bae0503edadef22cf7793ce51a1b8e5930623b2eff3c01212e57ee8",
"色阶/色阶.moef": "b653b0981e0975605d2857a87bd495885d3370d3e9bcd9dc3a59b0012bf1f79e",
"色阶/large.png": "fcea12f4367039ea1512d2e23d51b9ca5198172dc5b10a1ff94a828fe94f4802",
"色阶/small.png": "41cd1a9c4d3b68972181534abe0e91bdb9e01ef5559b6b1f7ef6bf305f450a76",
"黑白混色/黑白混色.moef": "96f2d1fc2fe5ed2a8eabdf3a3bf5eb7fff145d55a0ce05807dcd834d2b8e9b32",
"黑白混色/large.png": "6df07fb223ab43b2b5b6115bef4a1a97eed5cbeb6afab84e005c3a2bdfe01979",
"黑白混色/small.png": "5382be0d29b4a195b8639b3c325f80e9b8cecaa9c12837ab5cf57b6ea877ecbc",
"色彩平衡/色彩平衡.moef": "be935b1e399e2a47394b54b24fc2e32eb0622ae0cd28f83e1d2d895c3c1133d6",
"色彩平衡/large.png": "fa2ce9071dee52d7ab9dc7cf6020f8679df3af707663c9a57a28fcde73e6801e",
"色彩平衡/small.png": "12a72a9f26e6ee41613b16ed2402f94a04837e55895addc8f5c25137ad7feaa6",
"通道混合器/通道混合器.moef": "7c5889c052534edd0043f439f59fe31a987c9c626d9097ce7f3d7280a888b1e3",
"通道混合器/large.png": "5ae9d2683450a3a515822520911885a774e202aa924465602f7369a1e67c0c4c",
"通道混合器/small.png": "23bfafb79287855e037f98f0ab5cee10914384824b1a65f0247cad2dd239ef1c",
"胶片模拟/胶片模拟.moef": "a559c654976ce711d01ef5b81ccaf01df8d81a9de501780cccc519fb72c4b7f2",
"胶片模拟/large.png": "d36a794f9640874f6ad7f3523b9eac92ba7c6ef8fa7b63c4594fc68e87c2eee7",
"胶片模拟/small.png": "f125deaf0c8d55ecc04e555cfb133c40ff3703f34a663548c6b38b3196780eb1",
"镜头畸变修复/镜头畸变修复.moef": "5ddb7e97d718d1b78cbc162b042aed1debdd0fecd12b8596590d5de5307c19ae",
"镜头畸变修复/large.png": "a00136fb9276c41518ba6096314fb6772ad1dc9be4f4d766409239fa923cfcd1",
"镜头畸变修复/small.png": "1b2480cfa33e1ab54a1ffcd81d9496aac1354b0d2974d6616fe7128965c2ede3",
"CST 色彩空间转换/CST 色彩空间转换.moef": "96d684ec87cbef801316abd83a1c247360d9adf9dca52ae84881c400c898f1da",
"CST 色彩空间转换/large.png": "816db272970491181aca4b872f09ca1900ebf0e7f21fee5bd6e2b4daedea5306",
"CST 色彩空间转换/small.png": "677353684eeaa1986bd21580eb0f2dcf4486f8cfba3985686c2ecb67afed5dbc"
},
"shaderSHA256": "336e24998cd785ea976fbe4da11da3e8c76854373cdc9f57200f2dcb42a1f3ff",
"hostVerification": "verification/HostFluidity1.21.0.json",
"installedNativeChecks": 1050
}
+297
查看文件
@@ -0,0 +1,297 @@
{
"version": "1.21.0",
"build": 114,
"compiledSource": "90e512aabe72fff30046b4bf18d6a35f91c0c113",
"baselineVersion": "1.20.2",
"baselineBuild": 113,
"baselineSource": "046411ba8b2c2bf8549601b2e5a080fd9dccd31b",
"gpu": "Apple M4",
"method": "Headless Release renderer and IOSurface textures. Baseline renderer rebuilt from the unchanged 1.20.2 renderer source with its installed metallib. Candidate linked from the final build objects; metallib byte-matched to the installed build. 22 changing synthetic RGBA16Float frames per case, with partial and zero alpha, extended highlights and negative RGB. Source upload and host state preparation excluded. Measured renderer wall time includes final scope readback with the panel closed. Skipped 6 frames and recorded the middle of the remaining 16. Alternated test order. HSL source uses a bottom-left origin and other cases use top-left.",
"modes": {
"integrated": "Untouched integrated settings including default Sony CST",
"neutralHSL": "Untouched standalone HSL",
"activeBasic": "Integrated settings with +0.25 basic exposure"
},
"measurements": [
{
"build": 113,
"pair": "a",
"cases": [
{
"maxMs": 12.938208335981471,
"computePipelines": 16,
"firstMs": 77.44212499892456,
"width": 1920,
"mode": "integrated",
"medianMs": 7.354083332757
},
{
"maxMs": 2.787833334878087,
"computePipelines": 16,
"firstMs": 5.399999998189742,
"width": 1920,
"mode": "neutralHSL",
"medianMs": 2.0991666642657947
},
{
"maxMs": 6.76562499938882,
"computePipelines": 16,
"firstMs": 6.076875000871951,
"width": 1920,
"mode": "activeBasic",
"medianMs": 4.969249999703607
},
{
"maxMs": 29.241708332847338,
"computePipelines": 16,
"firstMs": 33.40008333179867,
"width": 3840,
"mode": "integrated",
"medianMs": 23.035124999296386
},
{
"maxMs": 8.66854166451958,
"computePipelines": 16,
"firstMs": 7.010708333837101,
"width": 3840,
"mode": "neutralHSL",
"medianMs": 7.675666667637415
},
{
"maxMs": 25.247833335015457,
"computePipelines": 16,
"firstMs": 24.129375000484288,
"width": 3840,
"mode": "activeBasic",
"medianMs": 19.690958331921138
}
]
},
{
"build": 114,
"pair": "a",
"cases": [
{
"maxMs": 6.538916666613659,
"computePipelines": 3,
"firstMs": 9.243958334991476,
"width": 1920,
"mode": "integrated",
"medianMs": 4.636333331291098
},
{
"maxMs": 2.6706666649261024,
"computePipelines": 3,
"firstMs": 5.093541665701196,
"width": 1920,
"mode": "neutralHSL",
"medianMs": 1.3894583316869102
},
{
"maxMs": 5.872749999980442,
"computePipelines": 3,
"firstMs": 66.25158333190484,
"width": 1920,
"mode": "activeBasic",
"medianMs": 4.331708332756534
},
{
"maxMs": 24.4553749980696,
"computePipelines": 3,
"firstMs": 25.604499998735264,
"width": 3840,
"mode": "integrated",
"medianMs": 15.133749999222346
},
{
"maxMs": 8.956791665696073,
"computePipelines": 3,
"firstMs": 6.821791666880017,
"width": 3840,
"mode": "neutralHSL",
"medianMs": 6.765833335521165
},
{
"maxMs": 17.701708333333954,
"computePipelines": 3,
"firstMs": 31.818916664633434,
"width": 3840,
"mode": "activeBasic",
"medianMs": 15.026791668788064
}
]
},
{
"build": 114,
"pair": "b",
"cases": [
{
"maxMs": 6.47824999759905,
"computePipelines": 3,
"firstMs": 8.391749997826992,
"width": 1920,
"mode": "integrated",
"medianMs": 3.9361249982903246
},
{
"maxMs": 3.493458334560273,
"computePipelines": 3,
"firstMs": 3.163458331982838,
"width": 1920,
"mode": "neutralHSL",
"medianMs": 1.6217500015045516
},
{
"maxMs": 11.122041665657889,
"computePipelines": 3,
"firstMs": 70.30949999898439,
"width": 1920,
"mode": "activeBasic",
"medianMs": 8.894208334822906
},
{
"maxMs": 22.29845833426225,
"computePipelines": 3,
"firstMs": 29.890708334278315,
"width": 3840,
"mode": "integrated",
"medianMs": 19.29470833420055
},
{
"maxMs": 3.057958332647104,
"computePipelines": 3,
"firstMs": 6.649041664786637,
"width": 3840,
"mode": "neutralHSL",
"medianMs": 2.682041664229473
},
{
"maxMs": 16.54995833450812,
"computePipelines": 3,
"firstMs": 22.187250000570202,
"width": 3840,
"mode": "activeBasic",
"medianMs": 14.910999998392072
}
]
},
{
"build": 113,
"pair": "b",
"cases": [
{
"maxMs": 8.093041666143108,
"computePipelines": 16,
"firstMs": 69.24862499727169,
"width": 1920,
"mode": "integrated",
"medianMs": 5.378374997235369
},
{
"maxMs": 3.8760833340347745,
"computePipelines": 16,
"firstMs": 5.63374999910593,
"width": 1920,
"mode": "neutralHSL",
"medianMs": 2.3266249991138466
},
{
"maxMs": 13.359000000491505,
"computePipelines": 16,
"firstMs": 6.309416665317258,
"width": 1920,
"mode": "activeBasic",
"medianMs": 8.464666665531695
},
{
"maxMs": 19.337375000759494,
"computePipelines": 16,
"firstMs": 23.844416664360324,
"width": 3840,
"mode": "integrated",
"medianMs": 17.469708331191214
},
{
"maxMs": 7.565374999103369,
"computePipelines": 16,
"firstMs": 6.806416666222503,
"width": 3840,
"mode": "neutralHSL",
"medianMs": 5.443375001050299
},
{
"maxMs": 21.247958331514383,
"computePipelines": 16,
"firstMs": 31.353166665212484,
"width": 3840,
"mode": "activeBasic",
"medianMs": 19.150083335262025
}
]
}
],
"exactLastFrameAndScopeSHA256": {
"a": {
"neutralHSL-1920.scope": "d443c82467d99bd6a88b846cd17a8b200aadc04000c9c7e3d13d37807d69b4b6",
"neutralHSL-3840.rgba16": "0ac067de6dbdafb632c22e19e46e9d96beb8c24d0138249949127460587a32c5",
"neutralHSL-1920.rgba16": "7247fe37fcf4ec2b3077b0c44e602a0b4031b76dd52f012b6301dabd56e1d051",
"integrated-1920.scope": "52f199d89d01220a3fca7472f61ccb3d828bb433ba411edd665a4c3169d834eb",
"activeBasic-3840.scope": "0108d9d7c89d8c60b3b8bbfb8f31853227d378a4253f8e3c3a009d72ffadeb3f",
"activeBasic-3840.rgba16": "8e094cc3639aaf3c0d1f3ff5725b0ecb85f80f7a3633c46c545fbd20fcc96bd9",
"activeBasic-1920.scope": "cf6ec23848953f6fca09f3ff35e1bc5d6515549dc7d1d061bdd98c7cbfd3fe33",
"integrated-1920.rgba16": "d6792912c85837afec62e56629ef749ff6a29594ba57e07eba4aa9cd64040546",
"integrated-3840.scope": "ec7f0cfba144c6662422b1804a483953ad7615f0d03aa6a60bd847f99c187af0",
"activeBasic-1920.rgba16": "b5dc08cfb483b8a657e4e7cbbac9ad456ac670a6ad7af842b2599b87d08d7358",
"integrated-3840.rgba16": "3a68492e8ea37b3ed93daaa9bc20a8ce24bbd475adf76fa45db4867900216330",
"neutralHSL-3840.scope": "5f576ba137f4f43b5106c132a4cfd7fb3297dc471b5224926f3f0040745d00dc"
},
"b": {
"neutralHSL-1920.scope": "d443c82467d99bd6a88b846cd17a8b200aadc04000c9c7e3d13d37807d69b4b6",
"neutralHSL-3840.rgba16": "0ac067de6dbdafb632c22e19e46e9d96beb8c24d0138249949127460587a32c5",
"neutralHSL-1920.rgba16": "7247fe37fcf4ec2b3077b0c44e602a0b4031b76dd52f012b6301dabd56e1d051",
"integrated-1920.scope": "52f199d89d01220a3fca7472f61ccb3d828bb433ba411edd665a4c3169d834eb",
"activeBasic-3840.scope": "0108d9d7c89d8c60b3b8bbfb8f31853227d378a4253f8e3c3a009d72ffadeb3f",
"activeBasic-3840.rgba16": "8e094cc3639aaf3c0d1f3ff5725b0ecb85f80f7a3633c46c545fbd20fcc96bd9",
"activeBasic-1920.scope": "cf6ec23848953f6fca09f3ff35e1bc5d6515549dc7d1d061bdd98c7cbfd3fe33",
"integrated-1920.rgba16": "d6792912c85837afec62e56629ef749ff6a29594ba57e07eba4aa9cd64040546",
"integrated-3840.scope": "ec7f0cfba144c6662422b1804a483953ad7615f0d03aa6a60bd847f99c187af0",
"activeBasic-1920.rgba16": "b5dc08cfb483b8a657e4e7cbbac9ad456ac670a6ad7af842b2599b87d08d7358",
"integrated-3840.rgba16": "3a68492e8ea37b3ed93daaa9bc20a8ce24bbd475adf76fa45db4867900216330",
"neutralHSL-3840.scope": "5f576ba137f4f43b5106c132a4cfd7fb3297dc471b5224926f3f0040745d00dc"
}
},
"installedNativeChecks": 1050,
"independentCSTReferenceCases": 21,
"focusedNativeResults": [
{
"error": "",
"name": "neutral-preview-frame",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "neutral-direct-preserves-hdr-negative-and-alpha",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"name": "neutral-render-defers-unused-gpu-pipelines",
"pass": true
},
{
"name": "final-scope-captured-with-neutral-output",
"pass": true
},
{
"name": "final-scope-inline-matches-separate-capture",
"pass": true
}
],
"limitations": [
"First-render times are affected by Metal compilation caches and machine scheduling; they are informational.",
"Warm wall time varied by run, especially the 4K CST path. No FCP presentation FPS or drop count was measured.",
"Six last-frame comparisons in each pair, not an exhaustive comparison of all parameter combinations."
]
}
+30
查看文件
@@ -0,0 +1,30 @@
{
"version": "1.21.0",
"build": 114,
"compiledSource": "90e512aabe72fff30046b4bf18d6a35f91c0c113",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": "Final Cut Pro 12.4",
"servicePID": 13297,
"project": "Existing independent default-preview QA duplicate",
"format": "1080p 25p",
"checks": {
"installedInspectorVersion": "1.21.0",
"existingEffect": "Standalone spider effect",
"playbackStart": "00:00:00:00",
"playbackEnd": "00:00:11:09",
"inspectorSlider": "Spider mix 1.00 → 0.50 → 1.00 via reset",
"workspaceSlider": "Spider mix 1.00 → 0.50 → 1.00 via reset",
"workspaceScopes": "Waveform, parade, histogram and vectorscope each reported 57,600 valid sRGB display-reference samples after rendering the edited/reset frame",
"installedNativeChecks": 1050,
"templates": 17
},
"firstScopeOpen": {
"requestedSeconds": 11.383333333,
"cachedSeconds": 11.36,
"observation": "Waiting until the next actual render; no stale frame substituted."
},
"limits": [
"FCP drop count, continuous drag latency, host Undo, same-time workspace reopen, Motion and full export not confirmed in this pass.",
"The real host playback used the standalone spider effect. Integrated default CST and inactive HSL were covered by the renderer benchmark and installed integration checks."
]
}
+132
查看文件
@@ -0,0 +1,132 @@
{
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.21.0.pkg",
"sha256": "ec1a57f23bf369d7a7841848d71d8ab78a7c229cbb5abe1c502e9964f87dbbcb",
"bytes": 44508770,
"testUnsigned": false,
"installationExecuted": false,
"checks": [
"PKG Developer ID Installer signature",
"PKG stapled ticket and Gatekeeper install assessment",
"must-close attached to root-authorized payload",
"all four FCP/Motion host identifiers",
"bundle relocation disabled",
"desktop and Bundle ID preinstall guards",
"postinstall contains actual FxPlug verification invocations",
"GUI worker, registration repair and Finder reveal present",
"successful completion and consecutive registration checks",
"exact payload contents: 大鱼调色.app",
"fixed FxPlug outer APP install path",
"outer APP has one real verification action",
"service path/identifier/registration version: com.dayu.color.XPC",
"nonempty FxPlug service manifest",
"payload APP signature, independent ticket and Gatekeeper",
"exact payload contents: 大鱼调色",
"login-user resource destination: ~/Movies/Motion Templates.localized/Effects.localized",
"complete outer APP payload present",
"welcome warns to save work and close hosts",
"conclusion gives manual APP and host restart instructions"
],
"resources": [
{
"source": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"payload": "Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.21.0",
"build": "114"
},
{
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs-81lueh25/大鱼调色",
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.41bb9e80-c269-4a80-b88c-4edb6aad9bc1/A487CF16-2495-4CDE-B156-411B7EFEF470/大鱼调色"
}
],
"signature": "Package \"大鱼调色-1.21.0.pkg\":\n Status: signed by a developer certificate issued by Apple for distribution\n Notarization: trusted by the Apple notary service\n Signed with a trusted timestamp on: 2026-11-08 08:25:14 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.21.0.pkg: accepted\nsource=Notarized Developer ID",
"pass": true,
"scope": "Expanded package structural and payload verification only; no installer scripts executed and no host quit or registration performed.",
"notarization": {
"createdDate": "2026-11-08T08:25:16.003Z",
"id": "29d5f921-6cd4-48a4-856a-2632f9a85e2b",
"status": "Accepted",
"message": "Successfully received submission info",
"name": "大鱼调色-1.21.0.pkg"
},
"appCompiledSource": "90e512aabe72fff30046b4bf18d6a35f91c0c113",
"appBuild": "114",
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
"residentAppClosing": {
"identifiers": [
"com.apple.FinalCut",
"com.apple.FinalCutApp",
"com.apple.motionapp",
"com.apple.motionappApp",
"com.dayu.color"
],
"preinstallGuardCount": 1,
"normalQuit": true
},
"packageEntryAdaptation": {
"upstreamEntrySHA256": "a1a8bc8920cfa2dfe4a7d65c4403eec8a8f3ec81b0736951578a81a80389bfc0",
"adaptedEntrySHA256": "4d9cef08673a690427de0757a5cfe42251d01aa47e40902a5155d46d01c71503",
"requiredApplication": "com.dayu.color"
},
"packageBuilderCommit": "eb53707c0e67d8ddeab8c1270bb079f1050cfafe",
"templateSHA256": {
"大鱼调色/大鱼调色.moef": "48d9ff4883cf189ae0a54b5cf412a898beb97b38d29d6cbc745d6cfa613dce60",
"大鱼调色/large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"大鱼调色/small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a",
"一级调色/一级调色.moef": "e4612f58eee5bf07a0a44cc5f6d65f9ca207b7f6946da938ed05f7d254ca7924",
"一级调色/large.png": "b9b990a46f3fd9b6974a1aba1a3e9bff11a287fd1615d4cd0f9e7393c302631b",
"一级调色/small.png": "77b36c042fb82219651e5bd22c1057b644c06a528a8962d4afecdcb8cab52635",
"蜘蛛盘校色仪/蜘蛛盘校色仪.moef": "68e91d3747a119e684f659093cb520a7fbd495336e8a1552316e52031e975ad5",
"蜘蛛盘校色仪/large.png": "52de21d5fc598fda331cd472b937cf4aaf69a09c80d49e7b168ac7804e9cd040",
"蜘蛛盘校色仪/small.png": "ea9b69d12948c5cd5f6acd9d000822d9fff6df3beec9dd278077a8ab66d455cd",
"基础调整/基础调整.moef": "ca6a584dd168990870fa774df8ba3fcfce5ad2e8de4d28bd656057fdaa1dbdca",
"基础调整/large.png": "a25e2b5ed50628ebe77220719528d14f21c25b5eecf37a5d60f211d2179ece43",
"基础调整/small.png": "3da91ae3461b882f5e1a557b4191d9aedaa6d329da70999eb7f26cbfb63a057f",
"肤色保护/肤色保护.moef": "06fdf5964f487a7cca3d6dce6e68013d3c0ba5b5c73c4bb392c7b58f5d916212",
"肤色保护/large.png": "f124e8f3d93c2be76ba26ba06d8b9c0b42e2c10dcb6300ae6ee7b7d7c7eb3025",
"肤色保护/small.png": "51fe525e67903101920a994d3540f368780d3aa9c0e54ebdb847871c82d81562",
"风格 LUT/风格 LUT.moef": "595f722d3ac99555d4e22611907b6273a3fb36fea59b8949be58eb1f7d319501",
"风格 LUT/large.png": "a9a4b48885752282535ec3ec2ffbe19bcd27af7132337e4a4ad3d104a2082692",
"风格 LUT/small.png": "9ae76ba957b1e94a5a03a600140f59e98861917d13da9124082810c509400e36",
"HSL/HSL.moef": "97bcbf240f86f485299c298d90f9339aa87a2751cef475e3d6a1637144d4ab13",
"HSL/large.png": "eaa2e7b025dc59416fddb8de8b9c56f0a7d34ba70facd7aa45cfb84660f7da78",
"HSL/small.png": "3a54428bc6821e75935aa1be0f149aac6e6ce05fcc059b7f0e90ceef9a41981e",
"曲线/曲线.moef": "3f235de32384a3b268982609583702d28470ed91c756f1b13947454f22bf3fc0",
"曲线/large.png": "273899eb6aa60fc0f7c8d41cc0e1f5a15b4c88a8803c00020a085ea874160870",
"曲线/small.png": "c17a2343b076650344b1c53ce92acf32f7696d66e32bda2d156996d4e3b834f5",
"颜色分级/颜色分级.moef": "c49877ada4fa0ac49fa497b62f3a3e09bfe15f0d73b352bdfbeb0a9a2b7b1aad",
"颜色分级/large.png": "f9afe6c3a76080a2a7c7ea98f24e62a74ab2e6fd8b4ad16ba9eb6065fef5d2ed",
"颜色分级/small.png": "9e9d7759f829d25a01a77422c989949b02ad34de81013f6b91505c4a3d1397e9",
"三原色/三原色.moef": "6015ecc2cc89116b05d601df920ae674bad9ad4c6e7bad1f0eac889e08cda60d",
"三原色/large.png": "bf7bfc893e294fc38c0f97e5594b6ba6e5c7126b9aae643754c89647e8bd5a1f",
"三原色/small.png": "2e28988e6bae0503edadef22cf7793ce51a1b8e5930623b2eff3c01212e57ee8",
"色阶/色阶.moef": "b653b0981e0975605d2857a87bd495885d3370d3e9bcd9dc3a59b0012bf1f79e",
"色阶/large.png": "fcea12f4367039ea1512d2e23d51b9ca5198172dc5b10a1ff94a828fe94f4802",
"色阶/small.png": "41cd1a9c4d3b68972181534abe0e91bdb9e01ef5559b6b1f7ef6bf305f450a76",
"黑白混色/黑白混色.moef": "96f2d1fc2fe5ed2a8eabdf3a3bf5eb7fff145d55a0ce05807dcd834d2b8e9b32",
"黑白混色/large.png": "6df07fb223ab43b2b5b6115bef4a1a97eed5cbeb6afab84e005c3a2bdfe01979",
"黑白混色/small.png": "5382be0d29b4a195b8639b3c325f80e9b8cecaa9c12837ab5cf57b6ea877ecbc",
"色彩平衡/色彩平衡.moef": "be935b1e399e2a47394b54b24fc2e32eb0622ae0cd28f83e1d2d895c3c1133d6",
"色彩平衡/large.png": "fa2ce9071dee52d7ab9dc7cf6020f8679df3af707663c9a57a28fcde73e6801e",
"色彩平衡/small.png": "12a72a9f26e6ee41613b16ed2402f94a04837e55895addc8f5c25137ad7feaa6",
"通道混合器/通道混合器.moef": "7c5889c052534edd0043f439f59fe31a987c9c626d9097ce7f3d7280a888b1e3",
"通道混合器/large.png": "5ae9d2683450a3a515822520911885a774e202aa924465602f7369a1e67c0c4c",
"通道混合器/small.png": "23bfafb79287855e037f98f0ab5cee10914384824b1a65f0247cad2dd239ef1c",
"胶片模拟/胶片模拟.moef": "a559c654976ce711d01ef5b81ccaf01df8d81a9de501780cccc519fb72c4b7f2",
"胶片模拟/large.png": "d36a794f9640874f6ad7f3523b9eac92ba7c6ef8fa7b63c4594fc68e87c2eee7",
"胶片模拟/small.png": "f125deaf0c8d55ecc04e555cfb133c40ff3703f34a663548c6b38b3196780eb1",
"镜头畸变修复/镜头畸变修复.moef": "5ddb7e97d718d1b78cbc162b042aed1debdd0fecd12b8596590d5de5307c19ae",
"镜头畸变修复/large.png": "a00136fb9276c41518ba6096314fb6772ad1dc9be4f4d766409239fa923cfcd1",
"镜头畸变修复/small.png": "1b2480cfa33e1ab54a1ffcd81d9496aac1354b0d2974d6616fe7128965c2ede3",
"CST 色彩空间转换/CST 色彩空间转换.moef": "96d684ec87cbef801316abd83a1c247360d9adf9dca52ae84881c400c898f1da",
"CST 色彩空间转换/large.png": "816db272970491181aca4b872f09ca1900ebf0e7f21fee5bd6e2b4daedea5306",
"CST 色彩空间转换/small.png": "677353684eeaa1986bd21580eb0f2dcf4486f8cfba3985686c2ecb67afed5dbc"
},
"payloadBundleAccess": {
"entries": 192,
"scope": "Read/traverse modes for installer-owned app entries, from the package BOM"
},
"installedAppHostAcceptance": "verification/HostFluidity1.21.0.json",
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。"
}
+14
查看文件
@@ -0,0 +1,14 @@
{
"compiledSource": "046411ba8b2c2bf8549601b2e5a080fd9dccd31b",
"trackedFiles": 798,
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"remoteBranch": "main",
"gitFsck": "pass",
"lfsPointers": 0,
"submodules": 0,
"tag": "v1.20.2-spider-scope-20261108",
"releaseCommit": "bc9021271d5e4992a6a63011e4ff197812029ab3",
"tagTrackedFiles": 802,
"tagGitFsck": "pass",
"buildInputsMatchCompiledSource": true
}
+23
查看文件
@@ -0,0 +1,23 @@
{
"repository": "dayu/dayu-color",
"repositoryID": 52,
"private": false,
"tag": "v1.20.2-spider-scope-20261108",
"releaseCommit": "bc9021271d5e4992a6a63011e4ff197812029ab3",
"appCompiledSource": "046411ba8b2c2bf8549601b2e5a080fd9dccd31b",
"version": "1.20.2",
"build": 113,
"releaseID": 413,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.20.2-spider-scope-20261108",
"prerelease": true,
"assetID": 59,
"assetName": "大鱼调色-1.20.2.pkg",
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.20.2-spider-scope-20261108/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.20.2.pkg",
"bytes": 44505420,
"sha256": "8edd792c6a9be629263baee68c4c3e7b67221ffd1e995bd8c9ab1f753eefd2b4",
"credentialSource": "macOS Keychain: dayu-git-api",
"draftDownloadURL": "https://dayu.media/git/attachments/f818322d-609a-4bae-a323-c5308bb78c80",
"passResult": true,
"draftVerification": "Authenticated browser download matched SHA-256 and byte count",
"verification": "Published release read-back and complete attachment download matched SHA-256 and byte count."
}
+9 -3
查看文件
@@ -35,7 +35,12 @@
[handler release];[request release];_faceEntries=[[NSData alloc]initWithBytes:entries.data() length:entries.size()*sizeof(DYToolMaskEntry)];[_faceCachedEntries release];_faceCachedEntries=[_faceEntries copy];
}
- (BOOL)renderSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools error:(NSError**)error {@synchronized(self){
DYUniforms effective=DYEffectiveFaceUniforms(u,paths,tools);BOOL face=effective.skinProtection.x>.5&&(effective.skinProtection.y>0||effective.skinVisualize>.5)&&(effective.skinFaceOnly>.5||effective.skinVisualize>.5);for(NSDictionary *node in tools[@"layers"]){DYUniforms layer=DYToolUniforms(node);face|=[node[@"type"]isEqual:@"skin"]&&!DYToolIsNeutral(node)&&layer.skinProtection.x>.5&&(layer.skinFaceOnly>.5||layer.skinVisualize>.5);}
DYUniforms effective=DYEffectiveFaceUniforms(u,paths,tools);BOOL face=effective.skinProtection.x>.5&&(effective.skinProtection.y>0||effective.skinVisualize>.5)&&(effective.skinFaceOnly>.5||effective.skinVisualize>.5);for(NSDictionary *node in tools[@"layers"]){
if(face)break;
if(![node[@"type"]isEqual:@"skin"]||DYToolIsNeutral(node))continue;
DYUniforms layer=DYToolUniforms(node);
face=layer.skinProtection.x>.5&&(layer.skinFaceOnly>.5||layer.skinVisualize>.5);
}
if(face&&!_exporting)[self prepareFaceSupport:src];else{[_faceEntries release];_faceEntries=nil;}
BOOL ok=[self renderToolsSource:src destination:dst uniforms:u paths:paths spider:spider tools:tools error:error];
return ok;
@@ -43,6 +48,7 @@
- (BOOL)renderLens:(FxImageTile*)source destination:(FxImageTile*)destination uniforms:(DYUniforms)u masks:(NSArray*)masks entry:(NSDictionary*)entry error:(NSError**)error {
if(source.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)u.lensCenterY=1-u.lensCenterY;
id<MTLDevice>d=entry[@"device"];id<MTLTexture>before=[source metalTextureForDevice:d],output=[destination metalTextureForDevice:d];
id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:entry[@"dyLensRepair"]];[ce setTexture:before atIndex:0];[ce setTexture:output atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];float aspect=before.width*source.pixelAspect/MAX(1.,(double)before.height);[ce setBytes:&aspect length:sizeof(aspect) atIndex:1];[ce dispatchThreads:MTLSizeMake(output.width,output.height,1)threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);
if(!masks.count)return YES;MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:output.pixelFormat width:output.width height:output.height mipmapped:NO];desc.storageMode=MTLStorageModePrivate;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;id<MTLTexture>blend=[d newTextureWithDescriptor:desc];if(!blend)return fail(error,@"无法分配修复蒙版");DYToolMaskHeader h{};h.section=(int)[DYToolTypes()indexOfObject:@"lens"];id<MTLBuffer>buffer=[self maskBuffer:@{@"lens":masks}tile:source device:d header:&h];cb=[entry[@"queue"]commandBuffer];[self encodeBlend:before after:output output:blend masks:buffer header:h entry:entry commands:cb];[cb commit];[cb waitUntilCompleted];DYExportTile *tile=[[DYExportTile alloc]initWithTexture:blend registry:d.registryID];[tile setBounds:destination.tilePixelBounds origin:destination.imageOrigin];[tile setPixelAspect:destination.pixelAspect];BOOL ok=cb.status==MTLCommandBufferStatusCompleted&&[self copyTile:tile to:destination entry:entry error:error];[tile release];[blend release];return ok;
id<MTLComputePipelineState> pipeline=[self computePipeline:@"dyLensRepair" entry:entry error:error];if(!pipeline)return NO;
id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:pipeline];[ce setTexture:before atIndex:0];[ce setTexture:output atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];float aspect=before.width*source.pixelAspect/MAX(1.,(double)before.height);[ce setBytes:&aspect length:sizeof(aspect) atIndex:1];[ce dispatchThreads:MTLSizeMake(output.width,output.height,1)threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);
if(!masks.count)return YES;MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:output.pixelFormat width:output.width height:output.height mipmapped:NO];desc.storageMode=MTLStorageModePrivate;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;id<MTLTexture>blend=[d newTextureWithDescriptor:desc];if(!blend)return fail(error,@"无法分配修复蒙版");DYToolMaskHeader h{};h.section=(int)[DYToolTypes()indexOfObject:@"lens"];id<MTLBuffer>buffer=[self maskBuffer:@{@"lens":masks}tile:source device:d header:&h];cb=[entry[@"queue"]commandBuffer];if(![self encodeBlend:before after:output output:blend masks:buffer header:h entry:entry commands:cb error:error]){[blend release];return NO;}[cb commit];[cb waitUntilCompleted];DYExportTile *tile=[[DYExportTile alloc]initWithTexture:blend registry:d.registryID];[tile setBounds:destination.tilePixelBounds origin:destination.imageOrigin];[tile setPixelAspect:destination.pixelAspect];BOOL ok=cb.status==MTLCommandBufferStatusCompleted&&[self copyTile:tile to:destination entry:entry error:error];[tile release];[blend release];return ok;
}
+9 -1
查看文件
@@ -20,6 +20,14 @@
ci=[[ci imageByApplyingFilter:@"CIGaussianBlur" withInputParameters:@{kCIInputRadiusKey:@(radius)}]imageByCroppingToRect:bounds];
[context render:ci toMTLTexture:output commandBuffer:commands bounds:bounds colorSpace:nil];return YES;
};
NSMutableArray *needed=[NSMutableArray arrayWithObject:@"dyFilmPoint"];
if(!mixer){
if(DYFilmBloomActive(u.film))[needed addObjectsFromArray:@[@"dyFilmSparseBlur",@"dyFilmBloomEdges"]];
if(DYFilmGrainActive(u.film))[needed addObject:@"dyFilmNoise"];
if(DYFilmPrintActive(u))[needed addObject:@"dyFilmPrint"];
if(u.film.mix<1)[needed addObject:@"dyFilmMix"];
}
for(NSString *name in needed)if(![self computePipeline:name entry:entry error:error])return NO;
auto encode=[&](NSString *name,id<MTLTexture>a,id<MTLTexture>b,id<MTLTexture>out,const void *data,NSUInteger length){
id<MTLComputeCommandEncoder>ce=[commands computeCommandEncoder];[ce setComputePipelineState:entry[name]];[ce setTexture:a atIndex:0];if(b)[ce setTexture:b atIndex:1];[ce setTexture:out atIndex:b?2:1];if(data)[ce setBytes:data length:length atIndex:0];[ce dispatchThreads:MTLSizeMake(out.width,out.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];
};
@@ -61,7 +69,7 @@
}
// Finish the effect before the module's existing mask blend. Source and
// result retain identical alpha, and an empty mask group means full coverage.
if(masks.count){id<MTLTexture>out=texture(current==slots[0]?1:0);if(!out)return fail(error,@"无法分配胶片蒙版缓冲区");DYToolMaskHeader header{};header.section=(int)[DYToolTypes()indexOfObject:type];id<MTLBuffer>buffer=[self maskBuffer:@{type:masks} tile:source device:d header:&header];[self encodeBlend:before after:current output:out masks:buffer header:header entry:entry commands:commands];current=out;}
if(masks.count){id<MTLTexture>out=texture(current==slots[0]?1:0);if(!out)return fail(error,@"无法分配胶片蒙版缓冲区");DYToolMaskHeader header{};header.section=(int)[DYToolTypes()indexOfObject:type];id<MTLBuffer>buffer=[self maskBuffer:@{type:masks} tile:source device:d header:&header];if(![self encodeBlend:before after:current output:out masks:buffer header:header entry:entry commands:commands error:error])return NO;current=out;}
[commands commit];[commands waitUntilCompleted];if(commands.status!=MTLCommandBufferStatusCompleted)return fail(error,commands.error.localizedDescription);
DYExportTile *result=[[[DYExportTile alloc]initWithTexture:current registry:d.registryID]autorelease];[result setBounds:source.tilePixelBounds origin:source.imageOrigin];[result setPixelAspect:source.pixelAspect];return [self copyTile:result to:destination entry:entry error:error];
}@catch(NSException *exception){return fail(error,[@"胶片处理失败:" stringByAppendingString:exception.reason?:@""]);}
+25 -8
查看文件
@@ -232,16 +232,30 @@ fragment half4 dySegmentFragment(DYRaster in [[stage_in]],
// Optional boundary conversion. Use this before both statistics and grading
// when the host supplies premultiplied RGB; all neighborhood samples then see
// the same straight RGB representation. Source and destination must differ.
inline half4 dyStraightSample(float4 sample) {
if (!(sample.a > 0.0f) || !all(isfinite(sample))) return half4(0.0h);
return half4(half3(sample.rgb / sample.a), half(sample.a));
}
kernel void dyUnpremultiply(texture2d<float, access::read> source [[texture(0)]],
texture2d<half, access::write> destination [[texture(1)]],
uint2 pixel [[thread_position_in_grid]]) {
if (pixel.x >= destination.get_width() || pixel.y >= destination.get_height()) return;
float4 sample = source.read(pixel);
if (!(sample.a > 0.0f) || !all(isfinite(sample))) {
destination.write(half4(0.0h), pixel);
return;
}
destination.write(half4(half3(sample.rgb / sample.a), half(sample.a)), pixel);
destination.write(dyStraightSample(source.read(pixel)), pixel);
}
// Match the historical half-precision alpha round trip without an intermediate
// texture when source and destination cover the same pixel grid.
fragment half4 dyNeutralInputFragment(DYRaster in [[stage_in]],texture2d<float,access::read> source [[texture(0)]]) {
uint2 size(source.get_width(),source.get_height());
half4 c=dyStraightSample(source.read(min(uint2(in.uv*float2(size)),size-1)));
return c.a>0.0h?half4(c.rgb*c.a,c.a):half4(0.0h);
}
fragment half4 dyNeutralOutputFragment(DYRaster in [[stage_in]],texture2d<half> source [[texture(0)]]) {
constexpr sampler f(coord::normalized,address::clamp_to_edge,filter::linear);
half4 c=source.sample(f,in.uv);
return c.a>0.0h?half4(c.rgb*c.a,c.a):half4(0.0h);
}
// Per-instance CPU analysis thumbnail. Host dispatches exactly 64x64 threads;
@@ -314,9 +328,12 @@ inline float3 dyDecode(float3 encoded) {
}
kernel void dyColorManagement(texture2d<float,access::read> source [[texture(0)]],
texture2d<half,access::write> destination [[texture(1)]],
constant DayuRenderParams& p [[buffer(0)]],constant float& amount [[buffer(1)]],uint2 pos [[thread_position_in_grid]]) {
constant DayuRenderParams& p [[buffer(0)]],constant float& amount [[buffer(1)]],
constant uint& premultiplied [[buffer(2)]],uint2 pos [[thread_position_in_grid]]) {
if(pos.x>=source.get_width()||pos.y>=source.get_height())return;
float4 sample=source.read(pos);if(!(sample.a>0)){destination.write(half4(0),pos);return;}
float4 sample=source.read(pos);
if(premultiplied)sample=float4(dyStraightSample(sample));
if(!(sample.a>0)){destination.write(half4(0),pos);return;}
float4 raw=float4(dyEncode(sample.rgb),sample.a),c=raw;
if(p.stages&1)c=cst_air(half4(c),p.input);
if(p.stages&2){if(p.reserved&8)c=cst_air(half4(c),p.basisInput);c=basis_air(half4(c),p.basis);if(p.reserved&8)c=cst_air(half4(c),p.basisOutput);}
@@ -23,3 +23,28 @@
NSError *idleError=nil;BOOL idleOK=[probe renderSource:source destination:destination uniforms:fresh paths:@{} spider:nil tools:doc error:&idleError];
run.record(@"idle-preview-empty-extra-skin-does-not-trigger-face-work",idleOK&&probe->faceCalls==3);
}
{
DYRenderer *fast=[[[DYRenderer alloc]init]autorelease];
DYUniforms untouched=defaults;untouched.primarySectionEnabled=0;
Pixels wide=input;
for(NSUInteger i=0;i<wide.size();i+=4){wide[i]*=-2;wide[i+1]*=4;}
id<MTLTexture> texture=[source metalTextureForDevice:gpu];
MTLRegion region=MTLRegionMake2D(0,0,width,height);
[texture replaceRegion:region mipmapLevel:0 withBytes:wide.data() bytesPerRow:width*8];
Pixels previewFrame=render(run,fast,source,destination,gpu,untouched,@{},@"neutral-preview-frame");
NSError *fastError=nil;CMTime time=CMTimeMake(5,24);
BOOL rendered=[fast renderHostSource:source destination:destination uniforms:untouched paths:@{} spider:nil tools:nil colorManagement:nil hostPrimaries:-1 atTime:time error:&fastError];
Difference delta=difference(previewFrame,read(destination,gpu));
BOOL direct=NO,lazy=YES;
for(NSDictionary *entry in [[fast valueForKey:@"devices"]allValues]){
for(NSString *key in entry[@"pipelines"])direct|=[key hasPrefix:@"dyNeutralInputFragment-"];
lazy&=!entry[@"dyFilmNoise"]&&!entry[@"dyCloneStamps"]&&!entry[@"dyLensRepair"];
}
run.record(@"neutral-direct-preserves-hdr-negative-and-alpha",rendered&&direct&&delta.maximum==0&&delta.nonfinite==0,measure(delta));
run.record(@"neutral-render-defers-unused-gpu-pipelines",lazy);
DYScopeSample *sample=[[[fast valueForKey:@"scopeLatest"]retain]autorelease];
run.record(@"final-scope-captured-with-neutral-output",[sample.metadata[@"timeValue"]integerValue]==5&&[sample.metadata[@"timeScale"]integerValue]==24&&sample.pixels.length==320*180*16);
[fast captureScopeTile:destination atTime:time];
run.record(@"final-scope-inline-matches-separate-capture",[sample.pixels isEqual:[[fast valueForKey:@"scopeLatest"]pixels]]);
[texture replaceRegion:region mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
}
+26 -18
查看文件
@@ -975,7 +975,7 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
id<FxCustomParameterActionAPI_v4> action=[self actionAPI]; if(!action)return;
_refreshing=YES;
uint64_t beta=DYBetaSpanBegin(@"inspector_refresh",nil);
BOOL groupingChanged=NO;NSString *recentPath=nil;
BOOL groupingChanged=NO;NSString *recentPath=nil;NSDictionary *stackDocument=nil;
[action startAction:self];
@try {
CMTime t=action.currentTime;
@@ -985,23 +985,31 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
NSDictionary *cms=_embedded?DYReadAssets(maskHost,t).colorManagement:assets.colorManagement;
NSDictionary *tools=DYReadTools(maskHost,t).document;
DYInspectorToken *oldToken=nil;[get getCustomParameterValue:&oldToken fromParameter:DYInspectorParameterID atTime:t];
BOOL wasUnified=_unified;
_unified=DYUnifiedColorState(cms);
groupingChanged=wasUnified!=_unified;
if(!_embedded&&!_workspaceEditor){
[_renderOrder release];_renderOrder=[DYUnifiedRenderOrder(tools)copy];
NSMutableDictionary *primary=nil,*output=nil;for(NSMutableDictionary *card in _cards){if([card[@"section"][@"key"]isEqual:@"primary"])primary=card;if([card[@"section"][@"key"]isEqual:@"output"])output=card;}
if(!_renderOrder||groupingChanged){
NSMutableDictionary *primary=nil,*output=nil;for(NSMutableDictionary *card in _cards){if([card[@"section"][@"key"]isEqual:@"primary"])primary=card;if([card[@"section"][@"key"]isEqual:@"output"])output=card;}
NSMutableArray *body=[NSMutableArray arrayWithArray:primary[@"body"]];
for(NSView *row in output[@"body"]){if([row.identifier isEqual:@"toolMasks"])continue;[body removeObjectIdenticalTo:row];[(_unified?output:primary)[@"view"]addSubview:row];if(!_unified)[body addObject:row];}
primary[@"body"]=body;
primary[@"body"]=body;
}
NSArray *order=DYUnifiedRenderOrder(tools);
if(![_renderOrder isEqualToArray:order]){[_renderOrder release];_renderOrder=[order copy];}
}
NSDictionary *initialTools=tools;
for(NSMutableDictionary *card in _cards){NSString *type=card[@"section"][@"key"];card[@"removed"]=@([type isEqual:@"output"]?!_unified:!_embedded&&DYBaseToolRemoved(initialTools,type));}
NSMutableDictionary *graphicValues=[NSMutableDictionary dictionary];
NSMutableDictionary *graphicValues=[NSMutableDictionary dictionary],*readValues=[NSMutableDictionary dictionary];
auto readValue=[&](NSNumber *pid,double fallback){
if(!pid)return fallback;
NSNumber *cached=readValues[pid];if(cached)return cached.doubleValue;
double value=fallback;[get getFloatValue:&value fromParameter:pid.unsignedIntValue atTime:t];
if(!std::isfinite(value))value=fallback;
readValues[pid]=@(value);return value;
};
for(NSNumber *pid in _controls) {
NSDictionary *r=_controls[pid],*d=r[@"descriptor"]; double v=[d[@"default"] doubleValue];
[get getFloatValue:&v fromParameter:pid.unsignedIntValue atTime:t];
if(!std::isfinite(v))v=[d[@"default"] doubleValue];
NSDictionary *r=_controls[pid],*d=r[@"descriptor"];double v=readValue(pid,[d[@"default"]doubleValue]);
graphicValues[d[@"key"]]=@(v);
if(d[@"enabled"]) {double enabled=1;[get getFloatValue:&enabled fromParameter:[d[@"enabled"] unsignedIntValue] atTime:t];[r[@"itemEnabled"] setState:enabled>=.5?NSControlStateValueOn:NSControlStateValueOff];[r[@"itemEnabled"] setImage:[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"]];for(NSString *control in @[@"slider",@"field",@"popup"]) [r[control] setAlphaValue:enabled>=.5?1:.45];}
if(d[@"enabled"]) {double enabled=readValue(d[@"enabled"],1);[r[@"itemEnabled"] setState:enabled>=.5?NSControlStateValueOn:NSControlStateValueOff];[r[@"itemEnabled"] setImage:[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"]];for(NSString *control in @[@"slider",@"field",@"popup"]) [r[control] setAlphaValue:enabled>=.5?1:.45];}
[r[@"slider"] setDoubleValue:v]; [r[@"field"] setStringValue:DYNumber(v,d)];
[r[@"toggle"] setState:v>=.5?NSControlStateValueOn:NSControlStateValueOff];
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0){NSArray *values=d[@"values"];NSInteger index=values?[values indexOfObject:@((int)llround(v))]:(NSInteger)llround(v);[popup selectItemAtIndex:index==NSNotFound?0:MAX(0,MIN(index,popup.numberOfItems-1))];}
@@ -1010,9 +1018,8 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
for(id graphic in _graphics)[graphic setValues:graphicValues];
for(NSMutableDictionary *c in _cards) {
NSNumber *pid=c[@"section"][@"enabled"];
double v=[c[@"section"][@"defaultEnabled"]doubleValue];if(pid)[get getFloatValue:&v fromParameter:pid.unsignedIntValue atTime:t];
NSNumber *extra=c[@"section"][@"extraEnabled"];double extraValue=0;
if(extra)[get getFloatValue:&extraValue fromParameter:extra.unsignedIntValue atTime:t];
double v=readValue(pid,[c[@"section"][@"defaultEnabled"]doubleValue]);
double extraValue=readValue(c[@"section"][@"extraEnabled"],0);
BOOL enabled=v>=.5||extraValue>=.5;
NSNumber *saved=[oldToken isKindOfClass:DYInspectorToken.class]?oldToken.folds[c[@"section"][@"key"]]:nil;
BOOL collapsed=_workspaceEditor?NO:saved?saved.boolValue:![self initiallyExpandedSection:c[@"section"][@"key"]];
@@ -1036,24 +1043,25 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
_tabs[@"managedColor"]=@(cms.count>0&&!DYPrimaryColorState(cms));_tabs[@"primaryCMS"]=@(DYPrimaryColorState(cms));[_managedPanel refreshWithState:assets.colorManagement context:[_renderer colorContext]];[_managedPanel setInputLUTPath:assets.paths[@"input"]];for(NSDictionary *r in _controls.allValues)if([r[@"descriptor"][@"key"]isEqual:@"cmmix"])[r[@"label"]setStringValue:([_tabs[@"managedColor"]boolValue]||[_tabs[@"primaryCMS"]boolValue])?@"调色混合":@"CST 混合"];
for(NSDictionary *c in _cards)if([c[@"section"][@"key"]isEqual:@"primary"]){[c[@"enabled"]setToolTip:([_tabs[@"managedColor"]boolValue]||_unified)?@"启停此层一级调色;全局色彩管理保持当前方式":@"启停此层输入、一级调色与输出转换"];[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];}
[_spiderPanel setMesh:assets.spiderMesh linked:assets.spiderLinked];
double profile=0,configured=0;[get getFloatValue:&profile fromParameter:2013 atTime:t];[get getFloatValue:&configured fromParameter:2236 atTime:t];
double profile=readValue(@2013,0),configured=readValue(@2236,0);
_tabs[@"legacyInput"]=@(configured<.5&&(configured<0||profile>.5||[assets.paths[@"input"]length]||oldToken.schema<2));
for(NSString *key in _assetButtons) {
NSString *path=assets.paths[key]; NSButton *button=_assetButtons[key][@"choose"];
NSString *name=path.length?path.lastPathComponent.stringByDeletingPathExtension:@"无";
if([key isEqual:@"input"]&&!path.length){double profile=0;[get getFloatValue:&profile fromParameter:2013 atTime:t];for(NSDictionary *d in DYDescriptors())if([d[@"key"]isEqual:@"inputProfile"]){NSArray *options=d[@"options"];NSInteger index=MAX(0,MIN((NSInteger)llround(profile),(NSInteger)options.count-1));name=options[index];break;}}
if([key isEqual:@"input"]&&!path.length){for(NSDictionary *d in DYDescriptors())if([d[@"key"]isEqual:@"inputProfile"]){NSArray *options=d[@"options"];NSInteger index=MAX(0,MIN((NSInteger)llround(profile),(NSInteger)options.count-1));name=options[index];break;}}
button.title=_assetLoads[key]?@"正在载入…":name; button.toolTip=path.length?path:@"选择输入转换或 LUT;点击网格图标浏览缩略图";
[_assetButtons[key][@"remove"] setEnabled:path.length>0];
NSButton *eye=_assetButtons[key][@"eye"];if(eye){NSInteger slot=[[key substringFromIndex:4]integerValue];double enabled=1;[get getFloatValue:&enabled fromParameter:2040+(UInt32)slot-1 atTime:t];eye.state=enabled>=.5?NSControlStateValueOn:NSControlStateValueOff;eye.image=[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"];}
NSButton *eye=_assetButtons[key][@"eye"];if(eye){NSInteger slot=[[key substringFromIndex:4]integerValue];double enabled=readValue(@(2040+(UInt32)slot-1),1);eye.state=enabled>=.5?NSControlStateValueOn:NSControlStateValueOff;eye.image=[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"];}
}
if(_recentBrowser)recentPath=[assets.paths[@"look0"]copy];
for(NSInteger i=1;i<5;i++)if([assets.paths[[NSString stringWithFormat:@"look%ld",(long)i]]length])_visibleLooks=MAX(_visibleLooks,i+1);
[self setNeedsLayout:YES];
if(!_embedded&&!_workspaceEditor)stackDocument=[[tools copy]autorelease];
} @finally { [action endAction:self]; _refreshing=NO; }
[_recentBrowser refreshRecentSelection:recentPath];[recentPath release];
// Remote layout/accessibility can re-enter the host. Let the parameter
// action and current callback unwind before notifying the remote view.
if(!_embedded&&!_workspaceEditor)[self synchronizeTools];
if(stackDocument)[self synchronizeTools:stackDocument];
DYBetaSpanEnd(beta,nil);
if(groupingChanged)dispatch_async(dispatch_get_main_queue(),^{NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);});
}
+6 -9
查看文件
@@ -1,18 +1,14 @@
- (void)managedPreview:(id<MTLTexture>)texture origin:(FxImageOrigin)origin entry:(NSMutableDictionary*)entry {
@synchronized(_previewLock){if(_exporting||CACurrentMediaTime()-_lastPreview<=.5)return;}
id<MTLComputePipelineState>p=[self managedKernel:@"dyManagedPreview" entry:entry error:nil];if(!p)return;
id<MTLComputePipelineState>p=[self computePipeline:@"dyManagedPreview" entry:entry error:nil];if(!p)return;
id<MTLBuffer>b=[entry[@"device"]newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];if(!b)return;
id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:p];[ce setTexture:texture atIndex:0];[ce setBuffer:b offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];
if(cb.status==MTLCommandBufferStatusCompleted){@synchronized(_previewLock){[_preview release];_preview=[[NSData alloc]initWithBytes:b.contents length:b.length];[_lookLUTPreview release];if(origin==kFxImageOrigin_BOTTOM_LEFT){NSMutableData *flipped=[NSMutableData dataWithLength:b.length];for(NSUInteger y=0;y<180;y++)memcpy((uint8_t*)flipped.mutableBytes+y*320*16,(uint8_t*)b.contents+(179-y)*320*16,320*16);_lookLUTPreview=[flipped copy];}else _lookLUTPreview=[_preview retain];_lastPreview=CACurrentMediaTime();}dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:@"DYPreviewDidChange" object:self];});}[b release];
}
// Included in DYRenderer. V1 callers and their ABI remain on renderSource:...tools:error:.
- (NSDictionary*)colorContext {@synchronized(_previewLock){return [[_colorContext copy]autorelease];}}
- (id<MTLComputePipelineState>)managedKernel:(NSString*)name entry:(NSMutableDictionary*)entry error:(NSError**)error {
NSMutableDictionary *cache=entry[@"managedKernels"];if(!cache){cache=[NSMutableDictionary dictionary];entry[@"managedKernels"]=cache;}
id<MTLComputePipelineState>pipeline=cache[name];if(!pipeline){id<MTLFunction>f=[entry[@"library"]newFunctionWithName:name];if(!f){fail(error,[@"色彩管理内核缺失:" stringByAppendingString:name]);return nil;}pipeline=[entry[@"device"]newComputePipelineStateWithFunction:f error:error];[f release];if(!pipeline)return nil;cache[name]=pipeline;[pipeline release];}return pipeline;
}
- (BOOL)managedDispatch:(NSString*)name textures:(NSArray*)textures data:(const void*)data length:(NSUInteger)length extra:(const void*)extra extraLength:(NSUInteger)extraLength entry:(NSMutableDictionary*)entry error:(NSError**)error {
id<MTLComputePipelineState>pipeline=[self managedKernel:name entry:entry error:error];if(!pipeline)return NO;
id<MTLComputePipelineState>pipeline=[self computePipeline:name entry:entry error:error];if(!pipeline)return NO;
id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:pipeline];for(NSUInteger i=0;i<textures.count;i++)[ce setTexture:textures[i] atIndex:i];if(data)[ce setBytes:data length:length atIndex:0];if(extra)[ce setBytes:extra length:extraLength atIndex:1];id<MTLTexture>t=textures[0];[ce dispatchThreads:MTLSizeMake(t.width,t.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];return cb.status==MTLCommandBufferStatusCompleted?YES:fail(error,cb.error.localizedDescription);
}
- (BOOL)managedConvert:(dycm::Space)from to:(dycm::Space)to display:(NSInteger)display gamut:(BOOL)gamut input:(id<MTLTexture>)input output:(id<MTLTexture>)output entry:(NSMutableDictionary*)entry error:(NSError**)error {
@@ -44,7 +40,8 @@
if(image.left!=bounds.left||image.right!=bounds.right||image.top!=bounds.top||image.bottom!=bounds.bottom){
fail(error,@"仿制图章需要宿主提供完整的源画面。");return nil;
}
NSDictionary *entry=[self device:registry error:error];if(!entry)return nil;
NSMutableDictionary *entry=[self device:registry error:error];if(!entry)return nil;
id<MTLComputePipelineState> pipeline=[self computePipeline:@"dyCloneStamps" entry:entry error:error];if(!pipeline)return nil;
id<MTLDevice>device=entry[@"device"];
id<MTLTexture>input=[source metalTextureForDevice:device];
if(!input||input.framebufferOnly){fail(error,@"仿制图章无法读取源画面。");return nil;}
@@ -55,7 +52,7 @@
id<MTLComputeCommandEncoder>encoder=[commands computeCommandEncoder];
if(!output||!encoder){fail(error,@"无法分配仿制图章缓冲区。");return nil;}
uint32_t count=(uint32_t)stamps.size(),flip=source.imageOrigin==kFxImageOrigin_BOTTOM_LEFT;
[encoder setComputePipelineState:entry[@"dyCloneStamps"]];
[encoder setComputePipelineState:pipeline];
[encoder setTexture:input atIndex:0];[encoder setTexture:output atIndex:1];
[encoder setBytes:stamps.data() length:count*sizeof(DYCloneStamp) atIndex:0];
[encoder setBytes:&count length:sizeof(count) atIndex:1];[encoder setBytes:&flip length:sizeof(flip) atIndex:2];
@@ -120,7 +117,7 @@
auto convert=[&](dycm::Space a,dycm::Space b,NSInteger display=0,BOOL gamut=NO){id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配色彩管理缓冲区。");BOOL ok=[self managedConvert:a to:b display:display gamut:gamut input:current output:out entry:entry error:error];if(ok)current=out;return ok;};
auto profile=[&](DYColorProfile*p){id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配颜色配置缓冲区。");BOOL ok=[self managedProfile:p input:current output:out entry:entry error:error];if(ok)current=out;return ok;};
auto tile=[&](id<MTLTexture>texture){DYExportTile*t=[[[DYExportTile alloc]initWithTexture:texture registry:d.registryID]autorelease];[t setBounds:src.tilePixelBounds origin:src.imageOrigin];[t setPixelAspect:src.pixelAspect];return t;};
auto blend=[&](id<MTLTexture>before,NSArray*masks,NSString*type){if(!masks.count)return YES;id<MTLTexture>out=next(before);if(!out)return fail(error,@"无法分配工作空间蒙版缓冲区。");DYToolMaskHeader h{};id<MTLBuffer>mb=[self maskBuffer:@{type:masks} tile:src device:d header:&h];h.section=(int)[DYToolTypes()indexOfObject:type];id<MTLComputePipelineState>p=[self managedKernel:@"dyManagedBlend" entry:entry error:error];if(!mb||!p)return NO;id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:p];[ce setTexture:before atIndex:0];[ce setTexture:current atIndex:1];[ce setTexture:out atIndex:2];[ce setBuffer:mb offset:0 atIndex:0];[ce setBytes:&h length:sizeof(h) atIndex:1];[ce dispatchThreads:MTLSizeMake(source.width,source.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);current=out;return YES;};
auto blend=[&](id<MTLTexture>before,NSArray*masks,NSString*type){if(!masks.count)return YES;id<MTLTexture>out=next(before);if(!out)return fail(error,@"无法分配工作空间蒙版缓冲区。");DYToolMaskHeader h{};id<MTLBuffer>mb=[self maskBuffer:@{type:masks} tile:src device:d header:&h];h.section=(int)[DYToolTypes()indexOfObject:type];id<MTLComputePipelineState>p=[self computePipeline:@"dyManagedBlend" entry:entry error:error];if(!mb||!p)return NO;id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:p];[ce setTexture:before atIndex:0];[ce setTexture:current atIndex:1];[ce setTexture:out atIndex:2];[ce setBuffer:mb offset:0 atIndex:0];[ce setBytes:&h length:sizeof(h) atIndex:1];[ce dispatchThreads:MTLSizeMake(source.width,source.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);current=out;return YES;};
auto basis=[&](DYUniforms values,NSArray*masks){values.cm.inputTransfer=values.cm.workingTransfer=values.cm.outputTransfer=1;values.cm.inputGamut=values.cm.workingGamut=values.cm.outputGamut=2;values.cm.toneMapping=0;values.inputSectionEnabled=values.cm.outputEnabled=0;if(values.primarySectionEnabled<.5||values.cm.basisEnabled<.5||identityCM(values)||values.cm.mix<=0)return YES;id<MTLTexture>before=current,out=next();BasisParams p=DYCMRender(values.cm).basis;float amount=values.cm.mix;if(!out||![self managedDispatch:@"dyManagedBasis" textures:@[current,out] data:&p length:sizeof(p) extra:&amount extraLength:4 entry:entry error:error])return NO;current=out;return blend(before,masks,@"primary");};
auto print=[&](DYUniforms values,NSArray*masks){if(!DYFilmPrintActive(values))return YES;NSArray*names=@[@"",@"kodak_2383",@"kodak_2393",@"kodak_2302_bw",@"fuji_3510",@"fuji_3513",@"fuji_3519",@"fuji_3521",@"agfa_cp30"];NSString*path=[[NSBundle bundleForClass:self.class]pathForResource:names[(int)values.filmPrint.x] ofType:@"dylut" inDirectory:@"PrintLooks"];id<MTLTexture>cube=path?[self lut:path entry:entry error:error]:nil;if(!cube)return fail(error,@"印片资源不可用。");id<MTLTexture>before=current,out=next();float amount=values.filmPrint.y*values.film.mix;if(!out||![self managedDispatch:@"dyManagedPrint" textures:@[current,cube,out] data:&amount length:4 extra:nullptr extraLength:0 entry:entry error:error])return NO;current=out;return blend(before,masks,@"film");};
@try{try{
+1 -1
查看文件
@@ -52,7 +52,7 @@
id<MTLBuffer>buffer=[self maskBuffer:face?@{}:@{@"primary":masks} tile:src device:device header:&header];_faceEntries=skinEntries;
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA32Float width:input.width height:input.height mipmapped:NO];desc.storageMode=MTLStorageModePrivate;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;
id<MTLTexture>output=[[device newTextureWithDescriptor:desc]autorelease];
id<MTLComputePipelineState>pipeline=[self managedKernel:@"dyLocalMosaic" entry:entry error:error];
id<MTLComputePipelineState>pipeline=[self computePipeline:@"dyLocalMosaic" entry:entry error:error];
if(!input||!buffer||!output||!pipeline){fail(error,@"局部马赛克缓冲区不可用。");return nil;}
// Size is in 1080-line reference pixels, stable under proxy/viewer scaling.
uint32_t block=(uint32_t)MAX(2,round([settings[@"size"]doubleValue]*input.height/1080.));
+35 -2
查看文件
@@ -44,13 +44,46 @@
if(!_modelRefreshPending.exchange(true)){id host=_apiManager;dispatch_async(dispatch_get_main_queue(),^{self->_modelRefreshPending.store(false);[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:host];});}return YES;}
- (BOOL)pluginState:(NSData**)state atTime:(CMTime)t quality:(FxQuality)q error:(NSError**)e{
uint64_t stateSpan=DYBetaSpanBegin(@"plugin_state",nil);@try{
DYUniforms u;DYReadUniforms(_apiManager,t,&u);CMTime frameDuration=kCMTimeInvalid,origin=kCMTimeZero;id<FxTimingAPI_v4>timing=[_apiManager apiForProtocol:@protocol(FxTimingAPI_v4)];if([timing respondsToSelector:@selector(frameDuration:)])[timing frameDuration:&frameDuration];if([timing respondsToSelector:@selector(startTimeForEffect:)])[timing startTimeForEffect:&origin];int64_t frame=DYFilmFrameIndex(t,frameDuration,origin);u.filmFrameKey=DYFilmFrameKey(frame,u.film.grainHold,u.film.grainSeed);DYAssetState*a=DYReadAssets(_apiManager,t);DYToolDocument *tools=DYReadTools(_apiManager,t);[self adoptToolCanvasDocument:tools.document];[_viewerParameterBridge publishUniforms:&u document:tools.document atTime:t];[_viewerParameterBridge publishAssets:a atTime:t];double copyAuto=0;[[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getFloatValue:&copyAuto fromParameter:8800 atTime:t];NSDictionary *snapshot=DYToolRenderSnapshot(tools.document,t);for(NSMutableDictionary *node in snapshot[@"layers"])if([node[@"type"]isEqual:@"film"]){DYUniforms layer=DYToolUniforms(node);node[@"filmFrameKey"]=@(DYFilmFrameKey(frame,layer.film.grainHold,layer.film.grainSeed));}NSInteger primaries=-1;id<FxColorGamutAPI_v2>gamut=[_apiManager apiForProtocol:@protocol(FxColorGamutAPI_v2)];if([gamut respondsToSelector:@selector(colorPrimaries)])primaries=gamut.colorPrimaries;NSDictionary*s=@{@"colorManagement":a.colorManagement?:@{},@"hostPrimaries":@(primaries),@"schema":@2,@"tools":snapshot,@"copyAuto":@(copyAuto>.5),@"uniforms":[NSData dataWithBytes:&u length:sizeof(u)],@"paths":a.paths?:@{},@"spider":a.spiderMesh?:[NSData data]};*state=[NSPropertyListSerialization dataWithPropertyList:s format:NSPropertyListBinaryFormat_v1_0 options:0 error:e];return *state!=nil;
DYUniforms u;DYReadUniforms(_apiManager,t,&u);
DYAssetState *assets=DYReadAssets(_apiManager,t);
DYToolDocument *tools=DYReadTools(_apiManager,t);
[self adoptToolCanvasDocument:tools.document];
[_viewerParameterBridge publishUniforms:&u document:tools.document atTime:t];
[_viewerParameterBridge publishAssets:assets atTime:t];
double copyAuto=0;
[[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getFloatValue:&copyAuto fromParameter:8800 atTime:t];
NSDictionary *snapshot=DYToolRenderSnapshot(tools.document,t);
// Host timing is needed only for an active time-varying grain pass.
BOOL hasFilmFrame=NO;
int64_t frame=0;
auto filmFrame=[&]{
if(!hasFilmFrame){
CMTime duration=kCMTimeInvalid,origin=kCMTimeZero;
id<FxTimingAPI_v4> timing=[_apiManager apiForProtocol:@protocol(FxTimingAPI_v4)];
if([timing respondsToSelector:@selector(frameDuration:)])[timing frameDuration:&duration];
if([timing respondsToSelector:@selector(startTimeForEffect:)])[timing startTimeForEffect:&origin];
frame=DYFilmFrameIndex(t,duration,origin);hasFilmFrame=YES;
}
return frame;
};
if(!DYBaseToolRemoved(snapshot,@"film")&&u.film.enabled>.5&&u.film.mix>0&&DYFilmGrainActive(u.film))
u.filmFrameKey=DYFilmFrameKey(filmFrame(),u.film.grainHold,u.film.grainSeed);
for(NSMutableDictionary *node in snapshot[@"layers"])if([node[@"type"]isEqual:@"film"]){
DYFilmSettings film=DYToolUniforms(node).film;
if(film.enabled>.5&&film.mix>0&&DYFilmGrainActive(film))node[@"filmFrameKey"]=@(DYFilmFrameKey(filmFrame(),film.grainHold,film.grainSeed));
}
NSInteger primaries=-1;
id<FxColorGamutAPI_v2> gamut=[_apiManager apiForProtocol:@protocol(FxColorGamutAPI_v2)];
if([gamut respondsToSelector:@selector(colorPrimaries)])primaries=gamut.colorPrimaries;
NSDictionary *s=@{@"colorManagement":assets.colorManagement?:@{},@"hostPrimaries":@(primaries),@"schema":@2,@"tools":snapshot,@"copyAuto":@(copyAuto>.5),@"uniforms":[NSData dataWithBytes:&u length:sizeof(u)],@"paths":assets.paths?:@{},@"spider":assets.spiderMesh?:[NSData data]};
*state=[NSPropertyListSerialization dataWithPropertyList:s format:NSPropertyListBinaryFormat_v1_0 options:0 error:e];
return *state!=nil;
}@finally{DYBetaSpanEnd(stateSpan,nil);}
}
- (BOOL)destinationImageRect:(FxRect*)rect sourceImages:(NSArray<FxImageTile*>*)src destinationImage:(FxImageTile*)dst pluginState:(NSData*)s atTime:(CMTime)t error:(NSError**)e{if(!src.count)return NO;*rect=src[0].imagePixelBounds;return YES;}
- (BOOL)sourceTileRect:(FxRect*)rect sourceImageIndex:(NSUInteger)i sourceImages:(NSArray<FxImageTile*>*)src destinationTileRect:(FxRect)dstRect destinationImage:(FxImageTile*)dst pluginState:(NSData*)s atTime:(CMTime)t error:(NSError**)e{if(i>=src.count)return NO;*rect=src[i].imagePixelBounds;return YES;}
- (BOOL)renderDestinationImage:(FxImageTile*)dst sourceImages:(NSArray<FxImageTile*>*)src pluginState:(NSData*)s atTime:(CMTime)t error:(NSError**)e{
if(!src.count||!src[0].ioSurface||!dst.ioSurface||!s.length)return NO;NSDictionary*p=[NSPropertyListSerialization propertyListWithData:s options:NSPropertyListImmutable format:NULL error:e];if(![p isKindOfClass:NSDictionary.class])return NO;NSData*b=p[@"uniforms"];if(![@[@1,@2]containsObject:p[@"schema"]]||![b isKindOfClass:NSData.class]||b.length!=sizeof(DYUniforms)||![p[@"paths"]isKindOfClass:NSDictionary.class])return NO;DYUniforms u;[b getBytes:&u length:sizeof(u)];uint64_t renderSpan=DYBetaSpanBegin(@"render",@{@"width":@(src[0].ioSurface.width),@"height":@(src[0].ioSurface.height),@"layer_count":@([p[@"tools"][@"layers"]count])});uint64_t beta=!_betaFirstRenderStarted.exchange(true)?DYBetaSpanBegin(@"first_render",nil):0;BOOL ok=NO;@try{ok=[_renderer renderSource:src[0] destination:dst uniforms:u paths:p[@"paths"] spider:p[@"spider"] tools:p[@"tools"] colorManagement:p[@"colorManagement"] hostPrimaries:p[@"hostPrimaries"]?[p[@"hostPrimaries"]integerValue]:-1 error:e];}@finally{DYBetaSpanEnd(renderSpan,@{@"status":ok?@"passed":@"failed"});}DYBetaSpanEnd(beta,@{@"status":ok?@"passed":@"failed"});if(!ok)DYBetaEvent(@"render_error",DYBetaErrorFields((e&&*e)?*e:nil,@"render_source"));if(ok){[_renderer captureScopeTile:dst atTime:t];@synchronized(self){
if(!src.count||!src[0].ioSurface||!dst.ioSurface||!s.length)return NO;NSDictionary*p=[NSPropertyListSerialization propertyListWithData:s options:NSPropertyListImmutable format:NULL error:e];if(![p isKindOfClass:NSDictionary.class])return NO;NSData*b=p[@"uniforms"];if(![@[@1,@2]containsObject:p[@"schema"]]||![b isKindOfClass:NSData.class]||b.length!=sizeof(DYUniforms)||![p[@"paths"]isKindOfClass:NSDictionary.class])return NO;DYUniforms u;[b getBytes:&u length:sizeof(u)];uint64_t renderSpan=DYBetaSpanBegin(@"render",@{@"width":@(src[0].ioSurface.width),@"height":@(src[0].ioSurface.height),@"layer_count":@([p[@"tools"][@"layers"]count])});uint64_t beta=!_betaFirstRenderStarted.exchange(true)?DYBetaSpanBegin(@"first_render",nil):0;BOOL ok=NO;@try{ok=[_renderer renderHostSource:src[0] destination:dst uniforms:u paths:p[@"paths"] spider:p[@"spider"] tools:p[@"tools"] colorManagement:p[@"colorManagement"] hostPrimaries:p[@"hostPrimaries"]?[p[@"hostPrimaries"]integerValue]:-1 atTime:t error:e];}@finally{DYBetaSpanEnd(renderSpan,@{@"status":ok?@"passed":@"failed"});}DYBetaSpanEnd(beta,@{@"status":ok?@"passed":@"failed"});if(!ok)DYBetaEvent(@"render_error",DYBetaErrorFields((e&&*e)?*e:nil,@"render_source"));if(ok){@synchronized(self){
FxRect image=src[0].imagePixelBounds;
double aspect=src[0].pixelAspect,height=image.top-image.bottom,width=image.right-image.left;
_toolSourceAspect=width>0&&height>0&&std::isfinite(aspect)&&aspect>0?width*aspect/height:0;
+1 -1
查看文件
@@ -12,7 +12,7 @@
auto dispatch=[&](NSString*name,const void*params,NSUInteger length,const void*extra=nullptr,NSUInteger extraLength=0){id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配一级 CST 缓冲区。");BOOL ok=[self managedDispatch:name textures:@[current,out] data:params length:length extra:extra extraLength:extraLength entry:entry error:error];if(ok)current=out;return ok;};
auto transform=[&](CSTParams p){if(p.inputTransfer==p.outputTransfer&&p.inputGamut==p.outputGamut&&!p.toneMapping)return YES;return dispatch(@"dyPrimaryCST",&p,sizeof(p));};
auto tile=[&](id<MTLTexture>t){DYExportTile*v=[[[DYExportTile alloc]initWithTexture:t registry:d.registryID]autorelease];[v setBounds:src.tilePixelBounds origin:src.imageOrigin];[v setPixelAspect:src.pixelAspect];return v;};
auto blend=[&](id<MTLTexture>before,NSArray*masks,float amount,NSString*type){if(!masks.count&&amount>=1)return YES;id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配一级混合缓冲区。");DYToolMaskHeader h{};id<MTLBuffer>mb=[self maskBuffer:@{type:masks?:@[]} tile:src device:d header:&h];h.section=(int)[DYToolTypes()indexOfObject:type];DYCSTMixParams p={{wg,wt,2,20,0},{2,20,wg,wt,0},amount};id<MTLComputePipelineState>pipeline=[self managedKernel:@"dyPrimaryBlend" entry:entry error:error];if(!pipeline||!mb)return NO;id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:pipeline];[ce setTexture:before atIndex:0];[ce setTexture:current atIndex:1];[ce setTexture:out atIndex:2];[ce setBuffer:mb offset:0 atIndex:0];[ce setBytes:&h length:sizeof(h) atIndex:1];[ce setBytes:&p length:sizeof(p) atIndex:2];[ce dispatchThreads:MTLSizeMake(source.width,source.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);current=out;return YES;};
auto blend=[&](id<MTLTexture>before,NSArray*masks,float amount,NSString*type){if(!masks.count&&amount>=1)return YES;id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配一级混合缓冲区。");DYToolMaskHeader h{};id<MTLBuffer>mb=[self maskBuffer:@{type:masks?:@[]} tile:src device:d header:&h];h.section=(int)[DYToolTypes()indexOfObject:type];DYCSTMixParams p={{wg,wt,2,20,0},{2,20,wg,wt,0},amount};id<MTLComputePipelineState>pipeline=[self computePipeline:@"dyPrimaryBlend" entry:entry error:error];if(!pipeline||!mb)return NO;id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:pipeline];[ce setTexture:before atIndex:0];[ce setTexture:current atIndex:1];[ce setTexture:out atIndex:2];[ce setBuffer:mb offset:0 atIndex:0];[ce setBytes:&h length:sizeof(h) atIndex:1];[ce setBytes:&p length:sizeof(p) atIndex:2];[ce dispatchThreads:MTLSizeMake(source.width,source.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);current=out;return YES;};
auto grade=[&](DYUniforms values,NSArray*masks,BOOL local){if(values.primarySectionEnabled<.5||values.cm.mix<=0)return YES;DYUniforms neutral=values;neutral.inputSectionEnabled=neutral.cm.outputEnabled=0;BOOL gradeNeutral=identityCM(neutral);if(!local&&gradeNeutral)return YES;if(local&&identityCM(values))return YES;
DayuRenderParams p=DYCMRender(values.cm);p.input.toneMapping=0;if((int)lroundf(values.cm.workingTransfer)==20){p.reserved|=8;p.basis.colorspace=10;p.basisInput={(int)lroundf(values.cm.workingGamut),20,(int)lroundf(values.cm.workingGamut),10,0};p.basisOutput={(int)lroundf(values.cm.workingGamut),10,(int)lroundf(values.cm.workingGamut),20,0};}CSTParams back={wg,wt,wg,wt,0};
if(local){p.stages=(values.inputSectionEnabled>.5?1:0)|(gradeNeutral?0:2)|(values.cm.outputEnabled>.5?4:0);back={values.cm.outputEnabled>.5?(int)lroundf(values.cm.outputGamut):(int)lroundf(values.cm.workingGamut),values.cm.outputEnabled>.5?(int)lroundf(values.cm.outputTransfer):(int)lroundf(values.cm.workingTransfer),wg,wt,0};}
+1
查看文件
@@ -43,5 +43,6 @@
- (NSDictionary *)scopeMetadata;
- (NSDictionary*)colorContext;
- (BOOL)renderSource:(FxImageTile*)source destination:(FxImageTile*)destination uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools colorManagement:(NSDictionary*)state hostPrimaries:(NSInteger)primaries error:(NSError**)error;
- (BOOL)renderHostSource:(FxImageTile*)source destination:(FxImageTile*)destination uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools colorManagement:(NSDictionary*)state hostPrimaries:(NSInteger)primaries atTime:(CMTime)time error:(NSError**)error;
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools colorManagement:(NSDictionary*)state error:(NSError**)error;
@end
+131 -29
查看文件
@@ -70,13 +70,15 @@ static void bypassNeutralTools(DYUniforms *u){
if(neutral)for(NSDictionary *row in DYDescriptors())if([row[@"pid"]isEqual:section[@"enabled"]])*(float*)((uint8_t*)u+[row[@"offset"]unsignedIntegerValue])=0;
}
}
static BOOL hasLegacyGrade(const DYUniforms &u){
if(u.curveSectionEnabled>.5||u.hslSectionEnabled>.5||u.colorGradingSectionEnabled>.5||u.primariesSectionEnabled>.5||u.levelsSectionEnabled>.5||u.blackWhiteSectionEnabled>.5||u.colorBalanceSectionEnabled>.5)return YES;
if(u.preLUTStrength!=0||u.postLUTStrength!=0||simd_any(u.extraPostLUTStrengths!=0))return YES;
const float *values=&u.exposure,*enabled=&u.exposureEnabled;
for(int i=0;i<13;i++){BOOL group=(i>=6&&i<=9)?u.colorSectionEnabled>.5:u.baseSectionEnabled>.5;if(group&&enabled[i]>.5&&values[i]!=0)return YES;}
return NO;
}
static void bypassIdleSkin(DYUniforms *u){
if(u->skinVisualize>.5)return;
if(u->curveSectionEnabled>.5||u->hslSectionEnabled>.5||u->colorGradingSectionEnabled>.5||u->primariesSectionEnabled>.5||u->levelsSectionEnabled>.5||u->blackWhiteSectionEnabled>.5||u->colorBalanceSectionEnabled>.5)return;
if(u->preLUTStrength!=0||u->postLUTStrength!=0||simd_any(u->extraPostLUTStrengths!=0))return;
const float *values=&u->exposure,*enabled=&u->exposureEnabled;
for(int i=0;i<13;i++){BOOL group=(i>=6&&i<=9)?u->colorSectionEnabled>.5:u->baseSectionEnabled>.5;if(group&&enabled[i]>.5&&values[i]!=0)return;}
u->skinProtection.x=0;
if(u->skinVisualize<=.5&&!hasLegacyGrade(*u))u->skinProtection.x=0;
}
// Decide face work from the same effective operations that textures: and the
// legacy renderer actually execute. Saved strengths remain 1 for empty LUT
@@ -124,6 +126,11 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
NSDictionary*rootPaths=visiblePaths(paths,u);u=normalize(u);NSMutableDictionary*doc=DYMutablePlist(tools);for(NSMutableDictionary*node in doc[@"layers"]){DYUniforms original=DYToolUniforms(node),v=normalize(original);NSMutableDictionary*values=[NSMutableDictionary dictionary];for(NSDictionary*d in DYBaseToolDescriptors(node[@"type"]))if([d[@"offset"]integerValue]>=0)values[d[@"key"]]=@(*(float*)((uint8_t*)&v+[d[@"offset"]unsignedIntegerValue]));node[@"values"]=values;node[@"paths"]=visiblePaths(node[@"paths"],original);}
return DYManagedActiveFinishing(u,rootPaths,spider,doc);
}
struct DYScopeReadback {
id<MTLBuffer> buffer;
NSUInteger generation;
uint64_t serial;
};
@interface DYRenderer(){
NSMutableDictionary *_devices,*_luts,*_preparedLUTs;
NSSet *_activeLUTPaths;
@@ -142,6 +149,9 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
NSUInteger _scopeGeneration;
DYScopeSample *_scopePending,*_scopeLatest;
uint64_t _scopeCaptureSerial,_scopeLatestSerial;CMTime _scopeRequestedTime;
FxImageTile *_scopeDestination; // borrowed for one locked host render
CMTime _scopeRenderTime;
BOOL _scopeCaptured;
NSData *_scopePreview;
NSDictionary *_scopeMetadata;
DYColorProfile *_scopeProfile;
@@ -149,6 +159,22 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
}
@end
@implementation DYRenderer
// The caller holds the renderer lock. Unused tools never load a GPU function.
- (id<MTLComputePipelineState>)computePipeline:(NSString *)name entry:(NSMutableDictionary *)entry error:(NSError **)error {
id<MTLComputePipelineState> pipeline=entry[name];
if(pipeline)return pipeline;
id<MTLLibrary> library=entry[@"library"];
id<MTLDevice> device=entry[@"device"];
id<MTLFunction> function=[library newFunctionWithName:name];
if(!function){fail(error,[name stringByAppendingString:@" 缺失"]);return nil;}
uint64_t span=DYBetaSpanBegin(@"gpu_pipeline",@{@"pipeline":name,@"gpu":device.name?:@"unknown"});
pipeline=[device newComputePipelineStateWithFunction:function error:error];
DYBetaSpanEnd(span,@{@"status":pipeline?@"passed":@"failed"});
[function release];
if(!pipeline)return nil;
entry[name]=pipeline;
return [pipeline autorelease];
}
#include "DYScopeCapture.inc.h"
#include "DYFilmRender.inc.h"
#include "DYPrimaryRender.inc.h"
@@ -192,7 +218,6 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
NSURL*url=[[NSBundle bundleForClass:self.class]URLForResource:@"default" withExtension:@"metallib"];
id<MTLLibrary>lib=[d newLibraryWithURL:url error:err];if(!lib){[d release];return nil;}
id<MTLCommandQueue>q=[d newCommandQueue];entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":d,@"library":lib,@"queue":q,@"pipelines":[NSMutableDictionary dictionary]}];
for(NSString*fn in @[@"dyLensRepair",@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis",@"dyScopeSample",@"dyCloneStamps",@"dyColorManagement",@"dyToolBlend",@"dyToolSkin",@"dyFilmPoint",@"dyFilmNoise",@"dyFilmSparseBlur",@"dyFilmBloomEdges",@"dyFilmMix",@"dyFilmPrint"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}uint64_t pipelineSpan=DYBetaSpanBegin(@"gpu_pipeline",@{@"pipeline":fn,@"gpu":d.name?:@"unknown"});id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];DYBetaSpanEnd(pipelineSpan,@{@"status":p?@"passed":@"failed"});[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
float identity[32];for(int z=0;z<2;z++)for(int y=0;y<2;y++)for(int x=0;x<2;x++){int i=((z*2+y)*2+x)*4;identity[i]=x;identity[i+1]=y;identity[i+2]=z;identity[i+3]=1;}id<MTLTexture>neutral=texture3D(d,identity,2);if(!neutral){fail(err,@"无法分配中性 LUT");return nil;}entry[@"identity"]=neutral;
// Preparing before the first frame may use registry 0. Reuse those pipelines
// when the host subsequently supplies that device's actual registry ID.
@@ -210,7 +235,7 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
- (NSArray*)textures:(NSDictionary*)paths uniforms:(DYUniforms*)u entry:(NSDictionary*)e error:(NSError**)err{
// Normalize only this render copy. Disabled groups retain their host parameters
// and paths, while inactive LUTs neither load files nor affect any layer.
BOOL inputEnabled=u->inputSectionEnabled>.5&&!managed(*u,paths);
BOOL inputEnabled=u->inputSectionEnabled>.5&&!managed(*u,paths)&&u->preLUTStrength>0;
NSString*input=inputEnabled?paths[@"input"]:nil;int profile=inputEnabled?(int)roundf(u->inputProfile):0;
if(!inputEnabled){u->inputProfile=0;u->preLUTStrength=0;}
if(!input.length&&profile>0&&profile<(int)inputFiles().count)input=[[NSBundle bundleForClass:self.class]pathForResource:inputFiles()[profile] ofType:@"dylut" inDirectory:@"InputLUTs"];
@@ -218,10 +243,20 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
NSMutableArray*ts=[NSMutableArray array];id<MTLTexture>t=[self lut:input entry:e error:err];if(!t)return nil;[ts addObject:t];if(!input.length)u->preLUTStrength=0;
BOOL looksEnabled=u->lookSectionEnabled>.5;
if(!looksEnabled)u->extraLookSectionEnableds=(DYFloat4){0,0,0,0};
for(int i=0;i<5;i++){BOOL active=looksEnabled&&(i==0||u->extraLookSectionEnableds[i-1]>.5);NSString*p=active?paths[[NSString stringWithFormat:@"look%d",i]]:nil;t=[self lut:p entry:e error:err];if(!t)return nil;[ts addObject:t];if(!p.length){if(i==0)u->postLUTStrength=0;else u->extraPostLUTStrengths[i-1]=0;}}
for(int i=0;i<5;i++){BOOL active=looksEnabled&&(i==0?u->postLUTStrength>0:u->extraLookSectionEnableds[i-1]>.5&&u->extraPostLUTStrengths[i-1]>0);NSString*p=active?paths[[NSString stringWithFormat:@"look%d",i]]:nil;t=[self lut:p entry:e error:err];if(!t)return nil;[ts addObject:t];if(!p.length){if(i==0)u->postLUTStrength=0;else u->extraPostLUTStrengths[i-1]=0;}}
[DYColorTables fillPrimaries:u];id<MTLDevice>d=e[@"device"];
id<MTLTexture>h=[_tables hslForDevice:d uniforms:u],w=[_tables whiteBalanceForDevice:d uniforms:u],g=[_tables gradingForDevice:d uniforms:u];if(!h||!w||!g){fail(err,_tables.lastError?:@"颜色查表构建失败");return nil;}[ts addObjectsFromArray:@[h,w,g]];return ts;
}
- (BOOL)renderHostSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools colorManagement:(NSDictionary*)state hostPrimaries:(NSInteger)primaries atTime:(CMTime)time error:(NSError**)error {
@synchronized(self){
_scopeDestination=dst;_scopeRenderTime=time;_scopeCaptured=NO;
@try{
BOOL ok=[self renderSource:src destination:dst uniforms:u paths:paths spider:spider tools:tools colorManagement:state hostPrimaries:primaries error:error];
if(ok&&!_scopeCaptured)[self captureScopeTile:dst atTime:time];
return ok;
}@finally{_scopeDestination=nil;}
}
}
- (BOOL)renderSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{return [self renderSource:src destination:dst uniforms:u paths:paths spider:nil error:err];}
- (BOOL)renderSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData *)spider error:(NSError**)err{return [self renderSource:src destination:dst uniforms:u paths:paths spider:spider tools:nil error:err];}
- (BOOL)renderLegacy:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData *)spider masks:(NSDictionary*)masks error:(NSError**)err{return [self renderLegacy:src destination:dst uniforms:u paths:paths spider:spider masks:masks stageFirst:-1 stageLast:-1 skinReference:nil originalReference:nil captureOriginal:nullptr suppressBlackWhite:NO error:err];}
@@ -232,8 +267,9 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
[_activeLUTPaths release];_activeLUTPaths=[[NSSet alloc]initWithArray:paths.allValues?:@[]];
NSMutableDictionary*e=[self device:dst.deviceRegistryID error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];id<MTLTexture>input=[src metalTextureForDevice:d],output=[dst metalTextureForDevice:d];if(!input||!output)return fail(err,@"宿主图像纹理不可用");
BOOL useCM=managed(u,paths)&&(!segmented||stageFirst==0);bypassNeutralTools(&u);float bwMix=fmaxf(0,fminf(1,u.cm.blackWhiteMix));if(bwMix<=0)u.blackWhiteSectionEnabled=0;
NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;bypassIdleSkin(&u);
BOOL useCM=managed(u,paths)&&(!segmented||stageFirst==0)&&!identityCM(u)&&u.cm.mix>0;
u=DYEffectiveFaceUniforms(u,paths,nil);
float bwMix=u.blackWhiteSectionEnabled>.5?fmaxf(0,fminf(1,u.cm.blackWhiteMix)):0;
// Only a deformed active mesh allocates samples; device entries retain the
// current buffer across frames. Neutral grids are exact identity at all densities.
simd_int2 spiderSize={0,0};id<MTLBuffer>spiderBuffer=nil;
@@ -245,30 +281,96 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
}
BOOL faceOnly=u.skinProtection.x>.5&&(u.skinProtection.y>0||u.skinVisualize>.5)&&u.skinFaceOnly>.5;
DYToolMaskHeader maskHeader{};id<MTLBuffer>maskBuffer=(masks.count||segmented||faceOnly||_faceEntries.length)?[self maskBuffer:masks tile:src device:d header:&maskHeader]:nil;maskHeader.faceOnly=faceOnly;BOOL hasMasks=maskHeader.count>0||maskHeader.faceOnly;if((hasMasks||segmented)&&!maskBuffer)return fail(err,@"无法分配蒙版缓冲区");
NSMutableDictionary*ps=e[@"pipelines"];NSString*format=[NSString stringWithFormat:@"%lu-%d-%d",(unsigned long)output.pixelFormat,hasMasks,segmented];id<MTLRenderPipelineState>pipeline=ps[format];if(!pipeline){MTLRenderPipelineDescriptor*p=[MTLRenderPipelineDescriptor new];p.vertexFunction=[e[@"library"]newFunctionWithName:@"dyVertex"];p.fragmentFunction=[e[@"library"]newFunctionWithName:segmented?@"dySegmentFragment":hasMasks?@"dyMaskedFragment":@"dyFragment"];p.colorAttachments[0].pixelFormat=output.pixelFormat;pipeline=[d newRenderPipelineStateWithDescriptor:p error:err];[p.vertexFunction release];[p.fragmentFunction release];[p release];if(!pipeline)return NO;ps[format]=pipeline;[pipeline release];}
MTLTextureDescriptor*td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:input.width height:input.height mipmapped:NO];td.storageMode=MTLStorageModePrivate;td.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;id<MTLTexture>straight=[d newTextureWithDescriptor:td];if(!straight)return fail(err,@"无法分配调色缓冲区");
id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyUnpremultiply"]];[ce setTexture:input atIndex:0];[ce setTexture:straight atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];
if(useCM&&!identityCM(u)&&u.cm.mix>0){
DayuRenderParams cm=DYCMRender(u.cm);cm.stages=(cm.stages&~1)|(u.inputSectionEnabled>.5?1:0);
if(cm.stages){id<MTLTexture>converted=[d newTextureWithDescriptor:td];if(!converted){[straight release];return fail(err,@"无法分配 CST 缓冲区");}
ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyColorManagement"]];[ce setTexture:straight atIndex:0];[ce setTexture:converted atIndex:1];[ce setBytes:&cm length:sizeof(cm) atIndex:0];[ce setBytes:&u.cm.mix length:4 atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];if(hasMasks){id<MTLTexture>blended=[d newTextureWithDescriptor:td];if(!blended){[converted release];[straight release];return fail(err,@"无法分配一级蒙版缓冲区");}maskHeader.section=0;maskHeader.premultiplied=0;[self encodeBlend:straight after:converted output:blended masks:maskBuffer header:maskHeader entry:e commands:cb];[converted release];converted=blended;}[straight release];straight=converted;
BOOL preview=NO;
@synchronized(_previewLock){preview=(!segmented||stageFirst==0)&&!_exporting&&CACurrentMediaTime()-_lastPreview>.5;}
BOOL neutral=!segmented&&!hasMasks&&!spiderBuffer&&u.skinVisualize<.5&&!hasLegacyGrade(u);
FxRect s=src.tilePixelBounds,t=dst.tilePixelBounds;
BOOL sameGrid=input.width==output.width&&input.height==output.height&&s.left==t.left&&s.right==t.right&&s.top==t.top&&s.bottom==t.bottom;
BOOL direct=neutral&&!useCM&&!preview&&sameGrid&&input!=output;
NSString *fragment=direct?@"dyNeutralInputFragment":neutral?@"dyNeutralOutputFragment":segmented?@"dySegmentFragment":hasMasks?@"dyMaskedFragment":@"dyFragment";
NSMutableDictionary *ps=e[@"pipelines"];
NSString *format=[NSString stringWithFormat:@"%lu-%d-%d",(unsigned long)output.pixelFormat,hasMasks,segmented];
if(neutral)format=[NSString stringWithFormat:@"%@-%lu",fragment,(unsigned long)output.pixelFormat];
id<MTLRenderPipelineState> pipeline=ps[format];
if(!pipeline){
MTLRenderPipelineDescriptor *desc=[[[MTLRenderPipelineDescriptor alloc]init]autorelease];
id<MTLLibrary> library=e[@"library"];
desc.vertexFunction=[[library newFunctionWithName:@"dyVertex"]autorelease];
desc.fragmentFunction=[[library newFunctionWithName:fragment]autorelease];
desc.colorAttachments[0].pixelFormat=output.pixelFormat;
pipeline=[[d newRenderPipelineStateWithDescriptor:desc error:err]autorelease];
if(!pipeline)return NO;
ps[format]=pipeline;
}
NSArray *ts=neutral?nil:[self textures:paths uniforms:&u entry:e error:err];
if(!neutral&&!ts)return NO;
id<MTLCommandBuffer> cb=[e[@"queue"]commandBuffer];
id<MTLTexture> straight=input;
if(!direct){
MTLTextureDescriptor *td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:input.width height:input.height mipmapped:NO];
td.storageMode=MTLStorageModePrivate;td.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;
straight=[[d newTextureWithDescriptor:td]autorelease];
if(!straight)return fail(err,@"无法分配调色缓冲区");
MTLSize grid=MTLSizeMake(input.width,input.height,1),group=MTLSizeMake(16,16,1);
BOOL fused=useCM&&!hasMasks;
if(!fused){
id<MTLComputePipelineState> unpremultiply=[self computePipeline:@"dyUnpremultiply" entry:e error:err];if(!unpremultiply)return NO;
id<MTLComputeCommandEncoder> ce=[cb computeCommandEncoder];
[ce setComputePipelineState:unpremultiply];[ce setTexture:input atIndex:0];[ce setTexture:straight atIndex:1];
[ce dispatchThreads:grid threadsPerThreadgroup:group];[ce endEncoding];
}
if(useCM){
DayuRenderParams cm=DYCMRender(u.cm);cm.stages=(cm.stages&~1)|(u.inputSectionEnabled>.5?1:0);
id<MTLComputePipelineState> cst=[self computePipeline:@"dyColorManagement" entry:e error:err];if(!cst)return NO;
id<MTLTexture> converted=fused?straight:[[d newTextureWithDescriptor:td]autorelease];
if(!converted)return fail(err,@"无法分配 CST 缓冲区");
uint32_t premultiplied=fused;
id<MTLComputeCommandEncoder> ce=[cb computeCommandEncoder];
[ce setComputePipelineState:cst];[ce setTexture:fused?input:straight atIndex:0];[ce setTexture:converted atIndex:1];
[ce setBytes:&cm length:sizeof(cm) atIndex:0];[ce setBytes:&u.cm.mix length:4 atIndex:1];[ce setBytes:&premultiplied length:4 atIndex:2];
[ce dispatchThreads:grid threadsPerThreadgroup:group];[ce endEncoding];
if(hasMasks){
id<MTLTexture> blended=[[d newTextureWithDescriptor:td]autorelease];if(!blended)return fail(err,@"无法分配一级蒙版缓冲区");
maskHeader.section=0;maskHeader.premultiplied=0;
if(![self encodeBlend:straight after:converted output:blended masks:maskBuffer header:maskHeader entry:e commands:cb error:err])return NO;
converted=blended;
}
straight=converted;
}
}
// Keep the actual post-CST straight source alive across all native segments.
// Both native spatial helpers and whites statistics historically read this
// source; the current segment's center color is a different input.
id<MTLTexture>nativeSource=segmented&&originalReference?[originalReference metalTextureForDevice:d]:straight;
if(!nativeSource){[straight release];return fail(err,@"原生工具参考纹理不可用");}
// Segments retain the original straight source for spatial tools and statistics.
id<MTLTexture> nativeSource=segmented&&originalReference?[originalReference metalTextureForDevice:d]:straight;
if(!nativeSource)return fail(err,@"原生工具参考纹理不可用");
if(segmented&&captureOriginal&&!*captureOriginal){DYExportTile *reference=[[DYExportTile alloc]initWithTexture:nativeSource registry:d.registryID];[reference setBounds:src.tilePixelBounds origin:src.imageOrigin];[reference setPixelAspect:src.pixelAspect];*captureOriginal=reference;}
float level=.5;id<MTLBuffer>scene=[d newBufferWithBytes:&level length:4 options:MTLResourceStorageModeShared];
if(!_exporting&&(!segmented||(stageFirst<=2&&stageLast>=2))&&u.whites>0&&u.whitesEnabled>.5&&u.baseSectionEnabled>.5){ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyWhitesSceneStatistics"]];[ce setTexture:nativeSource atIndex:0];[ce setTexture:ts[7] atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:scene offset:0 atIndex:1];[ce dispatchThreadgroups:MTLSizeMake(1,1,1) threadsPerThreadgroup:MTLSizeMake(256,1,1)];[ce endEncoding];}
BOOL preview=NO;@synchronized(_previewLock){preview=(!segmented||stageFirst==0)&&!_exporting&&CACurrentMediaTime()-_lastPreview>.5;}id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
id<MTLBuffer> scene=nil;
if(!neutral){
float level=.5;
scene=[[d newBufferWithBytes:&level length:4 options:MTLResourceStorageModeShared]autorelease];
if(!scene)return fail(err,@"无法分配调色统计缓冲区");
if(!_exporting&&(!segmented||(stageFirst<=2&&stageLast>=2))&&u.whites>0&&u.whitesEnabled>.5&&u.baseSectionEnabled>.5){
id<MTLComputePipelineState> stats=[self computePipeline:@"dyWhitesSceneStatistics" entry:e error:err];if(!stats)return NO;
id<MTLComputeCommandEncoder> ce=[cb computeCommandEncoder];
[ce setComputePipelineState:stats];[ce setTexture:nativeSource atIndex:0];[ce setTexture:ts[7] atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:scene offset:0 atIndex:0];
[ce dispatchThreadgroups:MTLSizeMake(1,1,1) threadsPerThreadgroup:MTLSizeMake(256,1,1)];[ce endEncoding];
}
}
id<MTLBuffer> pb=nil;
if(preview){
id<MTLComputePipelineState> analysis=[self computePipeline:@"dyInputAnalysis" entry:e error:err];if(!analysis)return NO;
pb=[[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared]autorelease];
if(!pb)return fail(err,@"无法分配输入预览缓冲区");
id<MTLComputeCommandEncoder> ce=[cb computeCommandEncoder];
[ce setComputePipelineState:analysis];[ce setTexture:straight atIndex:0];[ce setTexture:neutral?e[@"identity"]:ts[0] atIndex:1];
float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;
[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];
[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];
}
MTLRenderPassDescriptor*rp=[MTLRenderPassDescriptor renderPassDescriptor];rp.colorAttachments[0].texture=output;rp.colorAttachments[0].loadAction=MTLLoadActionDontCare;rp.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>re=[cb renderCommandEncoderWithDescriptor:rp];[re setRenderPipelineState:pipeline];
float w=output.width,h=output.height;FxRect s=src.tilePixelBounds,t=dst.tilePixelBounds;float sw=s.right-s.left,sh=s.top-s.bottom;float l=(t.left-s.left)/sw,r=(t.right-s.left)/sw,top=(s.top-t.top)/sh,bottom=(s.top-t.bottom)/sh;
float w=output.width,h=output.height;float sw=s.right-s.left,sh=s.top-s.bottom;float l=(t.left-s.left)/sw,r=(t.right-s.left)/sw,top=(s.top-t.top)/sh,bottom=(s.top-t.bottom)/sh;
if(src.imageOrigin==kFxImageOrigin_BOTTOM_LEFT){top=1-top;bottom=1-bottom;}
DYVertex2D vs[]={{{w/2,-h/2},{r,bottom}},{{-w/2,-h/2},{l,bottom}},{{w/2,h/2},{r,top}},{{-w/2,h/2},{l,top}}};
if(dst.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)for(int i=0;i<4;i++)vs[i].position.y=-vs[i].position.y;
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,bwMix,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];DYUniforms color=u;color.blackWhiteSectionEnabled=0;[re setFragmentBytes:&color length:sizeof(color) atIndex:3];if(spiderBuffer)[re setFragmentBuffer:spiderBuffer offset:0 atIndex:4];else{float empty[2]={0,0};[re setFragmentBytes:empty length:sizeof(empty) atIndex:4];}[re setFragmentBytes:&spiderSize length:sizeof(spiderSize) atIndex:5];if(hasMasks||segmented){[re setFragmentBuffer:maskBuffer offset:0 atIndex:6];[re setFragmentBytes:&maskHeader length:sizeof(maskHeader) atIndex:7];}if(segmented){DYToolStageRange range={(int)stageFirst,(int)stageLast,(int)suppressBlackWhite};[re setFragmentBytes:&range length:sizeof(range) atIndex:8];[re setFragmentTexture:skinReference?[skinReference metalTextureForDevice:d]:input atIndex:10];[re setFragmentTexture:nativeSource atIndex:11];}[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];if(!neutral){for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,bwMix,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];DYUniforms color=u;color.blackWhiteSectionEnabled=0;[re setFragmentBytes:&color length:sizeof(color) atIndex:3];if(spiderBuffer)[re setFragmentBuffer:spiderBuffer offset:0 atIndex:4];else{float empty[2]={0,0};[re setFragmentBytes:empty length:sizeof(empty) atIndex:4];}[re setFragmentBytes:&spiderSize length:sizeof(spiderSize) atIndex:5];if(hasMasks||segmented){[re setFragmentBuffer:maskBuffer offset:0 atIndex:6];[re setFragmentBytes:&maskHeader length:sizeof(maskHeader) atIndex:7];}if(segmented){DYToolStageRange range={(int)stageFirst,(int)stageLast,(int)suppressBlackWhite};[re setFragmentBytes:&range length:sizeof(range) atIndex:8];[re setFragmentTexture:skinReference?[skinReference metalTextureForDevice:d]:input atIndex:10];[re setFragmentTexture:nativeSource atIndex:11];}}[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];BOOL ok=[self completeCommands:cb destination:dst texture:output entry:e];
if(ok&&pb){@synchronized(_previewLock){
[_preview release];_preview=[[NSData alloc]initWithBytes:pb.contents length:320*180*16];
// The analysis kernel reads physical texture rows. Its result remains intact
@@ -281,7 +383,7 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
}else _lookLUTPreview=[_preview retain];
_lastPreview=CACurrentMediaTime();[self notifyPreviewChanged];
}}
if(!ok)fail(err,cb.error.localizedDescription);[pb release];[straight release];[scene release];return ok;
if(!ok)fail(err,cb.error.localizedDescription);return ok;
});}}
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{return [self exportLUT:url uniforms:u paths:paths spider:nil error:err];}
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider error:(NSError**)err{@synchronized(self){
+66 -27
查看文件
@@ -80,37 +80,76 @@
}});
return raster;
}
- (void)captureScopeTile:(FxImageTile *)tile atTime:(CMTime)time{
NSUInteger generation;uint64_t serial;@synchronized(_previewLock){if(_exporting||!tile)return;generation=_scopeGeneration;serial=++_scopeCaptureSerial;}
@autoreleasepool{@try{
NSDictionary *entry=nil,*context=nil;@synchronized(self){entry=[[self device:tile.deviceRegistryID error:nil]retain];context=[_colorContext copy];}
id<MTLDevice>device=entry[@"device"];id<MTLTexture>texture=[tile metalTextureForDevice:device];
if(!entry||!texture||!texture.width||!texture.height||texture.framebufferOnly){[entry release];[context release];return;}
id<MTLBuffer>buffer=[device newBufferWithLength:dyscope::Width*dyscope::Height*sizeof(dyscope::RGBA) options:MTLResourceStorageModeShared];
id<MTLCommandBuffer>command=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>encoder=[command computeCommandEncoder];
if(!buffer||!encoder){[buffer release];[entry release];[context release];return;}
uint32_t flip=tile.imageOrigin==kFxImageOrigin_BOTTOM_LEFT;[encoder setComputePipelineState:entry[@"dyScopeSample"]];[encoder setTexture:texture atIndex:0];[encoder setBuffer:buffer offset:0 atIndex:0];[encoder setBytes:&flip length:sizeof(flip) atIndex:1];
[encoder dispatchThreads:MTLSizeMake(dyscope::Width,dyscope::Height,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[encoder endEncoding];[command commit];
// The host may recycle its destination as soon as render returns. Complete
// only this 320x180 readback while that ownership is still guaranteed.
// CPU profile conversion, plotting and UI notification do not block render.
[command waitUntilCompleted];
if(command.status!=MTLCommandBufferStatusCompleted){[buffer release];[entry release];[context release];return;}
DYScopeSample *sample=[DYScopeSample new];sample.pixels=[NSData dataWithBytes:buffer.contents length:buffer.length];sample.generation=generation;
CGColorSpaceRef sourceSpace=DYManagedTileSpace(tile,[context[@"primaries"]integerValue]);sample.space=sourceSpace;if(sourceSpace)CGColorSpaceRelease(sourceSpace);
FxRect bounds=tile.tilePixelBounds,image=tile.imagePixelBounds;BOOL whole=bounds.left==image.left&&bounds.right==image.right&&bounds.top==image.top&&bounds.bottom==image.bottom;
sample.metadata=@{@"time":@(CMTimeGetSeconds(time)),@"timeValue":@(time.value),@"timeScale":@(time.timescale),@"timeEpoch":@(time.epoch),@"source":context[@"destination"]?:@"宿主 RGB",@"wholeImage":@(whole),@"region":whole?@"整帧取样":@"仅当前宿主输出分块",@"width":@(dyscope::Width),@"height":@(dyscope::Height)};
[buffer release];[entry release];[context release];
BOOL start=NO,notifyOutput=NO;@synchronized(_previewLock){
if(serial>=_scopeLatestSerial){
[_scopeLatest release];_scopeLatest=[sample retain];_scopeLatestSerial=serial;
// The caller owns the destination until command completion. Only the small
// result buffer is copied out of that lifetime, even when the scope is closed.
- (DYScopeReadback)encodeScopeTile:(FxImageTile *)tile texture:(id<MTLTexture>)texture entry:(NSMutableDictionary *)entry commands:(id<MTLCommandBuffer>)command {
if(_exporting||!tile||!texture.width||!texture.height||texture.framebufferOnly)return {};
id<MTLComputePipelineState> pipeline=[self computePipeline:@"dyScopeSample" entry:entry error:nil];
if(!pipeline)return {};
id<MTLBuffer> buffer=entry[@"scopeBuffer"];
if(!buffer){
id<MTLDevice> device=entry[@"device"];
buffer=[[device newBufferWithLength:dyscope::Width*dyscope::Height*sizeof(dyscope::RGBA) options:MTLResourceStorageModeShared]autorelease];
if(!buffer)return {};
entry[@"scopeBuffer"]=buffer;
}
id<MTLComputeCommandEncoder> encoder=[command computeCommandEncoder];
if(!encoder)return {};
uint32_t flip=tile.imageOrigin==kFxImageOrigin_BOTTOM_LEFT;
[encoder setComputePipelineState:pipeline];[encoder setTexture:texture atIndex:0];
[encoder setBuffer:buffer offset:0 atIndex:0];[encoder setBytes:&flip length:sizeof(flip) atIndex:1];
[encoder dispatchThreads:MTLSizeMake(dyscope::Width,dyscope::Height,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];
[encoder endEncoding];
@synchronized(_previewLock){return {buffer,_scopeGeneration,++_scopeCaptureSerial};}
}
- (void)publishScopeReadback:(DYScopeReadback)readback tile:(FxImageTile *)tile atTime:(CMTime)time {
if(!readback.buffer)return;
@try{
DYScopeSample *sample=[[[DYScopeSample alloc]init]autorelease];
sample.pixels=[NSData dataWithBytes:readback.buffer.contents length:readback.buffer.length];
sample.generation=readback.generation;
CGColorSpaceRef space=DYManagedTileSpace(tile,[_colorContext[@"primaries"]integerValue]);
sample.space=space;if(space)CGColorSpaceRelease(space);
FxRect bounds=tile.tilePixelBounds,image=tile.imagePixelBounds;
BOOL whole=bounds.left==image.left&&bounds.right==image.right&&bounds.top==image.top&&bounds.bottom==image.bottom;
sample.metadata=@{@"time":@(CMTimeGetSeconds(time)),@"timeValue":@(time.value),@"timeScale":@(time.timescale),@"timeEpoch":@(time.epoch),@"source":_colorContext[@"destination"]?:@"宿主 RGB",@"wholeImage":@(whole),@"region":whole?@"整帧取样":@"仅当前宿主输出分块",@"width":@(dyscope::Width),@"height":@(dyscope::Height)};
BOOL start=NO,notifyOutput=NO;
@synchronized(_previewLock){
if(readback.serial>=_scopeLatestSerial){
[_scopeLatest release];_scopeLatest=[sample retain];_scopeLatestSerial=readback.serial;
if(_outputObserved&&!_outputNotificationPending){_outputNotificationPending=YES;notifyOutput=YES;}
}
if(_scopeEnabled&&serial==_scopeLatestSerial&&(generation==_scopeGeneration||!CMTIME_IS_NUMERIC(_scopeRequestedTime)||CMTimeCompare(time,_scopeRequestedTime)==0)){sample.generation=_scopeGeneration;[_scopePending release];_scopePending=[sample retain];if(!_scopeWorkerRunning){_scopeWorkerRunning=YES;start=YES;}}
}[sample release];
if(_scopeEnabled&&readback.serial==_scopeLatestSerial&&(readback.generation==_scopeGeneration||!CMTIME_IS_NUMERIC(_scopeRequestedTime)||CMTimeCompare(time,_scopeRequestedTime)==0)){
sample.generation=_scopeGeneration;[_scopePending release];_scopePending=[sample retain];
if(!_scopeWorkerRunning){_scopeWorkerRunning=YES;start=YES;}
}
}
if(notifyOutput)[self queueOutputNotification];
if(start)dispatch_async(_scopeQueue,^{[self processPendingScopeSamples];});
}@catch(NSException *exception){/* Scope diagnostics must never fail rendering. */}}
}@catch(NSException *exception){/* Scope diagnostics must never fail rendering. */}
}
- (BOOL)completeCommands:(id<MTLCommandBuffer>)command destination:(FxImageTile *)destination texture:(id<MTLTexture>)texture entry:(NSMutableDictionary *)entry {
DYScopeReadback readback{};
if(destination==_scopeDestination){
@try{readback=[self encodeScopeTile:destination texture:texture entry:entry commands:command];}
@catch(NSException *exception){/* Fall back to separate sampling. */}
}
[command commit];[command waitUntilCompleted];
if(command.status!=MTLCommandBufferStatusCompleted)return NO;
if(readback.buffer){[self publishScopeReadback:readback tile:destination atTime:_scopeRenderTime];_scopeCaptured=YES;}
return YES;
}
- (void)captureScopeTile:(FxImageTile *)tile atTime:(CMTime)time {
@synchronized(self){@autoreleasepool{@try{
if(!tile||_exporting)return;
NSMutableDictionary *entry=[self device:tile.deviceRegistryID error:nil];
id<MTLTexture> texture=[tile metalTextureForDevice:entry[@"device"]];
id<MTLCommandBuffer> command=[entry[@"queue"]commandBuffer];
DYScopeReadback readback=[self encodeScopeTile:tile texture:texture entry:entry commands:command];
if(!readback.buffer)return;
[command commit];[command waitUntilCompleted];
if(command.status==MTLCommandBufferStatusCompleted)[self publishScopeReadback:readback tile:tile atTime:time];
}@catch(NSException *exception){/* Scope diagnostics must never fail rendering. */}}}
}
- (void)processPendingScopeSamples{
for(;;){@autoreleasepool{
+4 -5
查看文件
@@ -1,13 +1,12 @@
- (void)synchronizeTools {
id<FxCustomParameterActionAPI_v4>a=[self actionAPI];if(!a)return;[a startAction:self];NSDictionary *document=nil;@try{document=[DYReadTools(_manager,a.currentTime).document copy];}@finally{[a endAction:self];}
- (void)synchronizeTools:(NSDictionary *)document {
NSMutableArray *order=[NSMutableArray array];NSMutableDictionary *numbers=[NSMutableDictionary dictionary],*roots=[NSMutableDictionary dictionary];
for(NSString *orderedID in DYToolDisplayOrder(document)){NSDictionary *node=DYToolWithID(document,orderedID);if(!node)continue;NSString *ID=node[@"id"],*type=node[@"type"];[order addObject:ID];roots[ID]=DYToolRootAnchor(document,ID)?:@"tail";NSInteger number=(numbers[type]?[numbers[type]integerValue]:(DYBaseToolRemoved(document,type)?0:1))+1;numbers[type]=@(number);
DYInspector *view=_stackViews[ID];if(!view){DYToolManager *manager=[[[DYToolManager alloc]initWithHost:_manager node:node]autorelease];view=[[[DYInspector alloc]initWithAPIManager:manager renderer:_renderer]autorelease];_stackViews[ID]=view;[_document addSubview:view];}
DYInspector *view=_stackViews[ID];BOOL existed=view!=nil;if(!view){DYToolManager *manager=[[[DYToolManager alloc]initWithHost:_manager node:node]autorelease];view=[[[DYInspector alloc]initWithAPIManager:manager renderer:_renderer]autorelease];_stackViews[ID]=view;[_document addSubview:view];}
if(view->_cards.count){NSDictionary *section=view->_cards[0][@"section"];NSString *title=[NSString stringWithFormat:@"%@ %ld",section[@"title"],(long)number];[view->_cards[0][@"header"]setTitle:title];[view->_cards[0][@"removeButton"]setAccessibilityLabel:[title stringByAppendingString:@"删除此层"]];}
[view refresh];[view setNeedsLayout:YES];
if(existed)[view refresh];
}
for(NSString *ID in [[_stackViews.allKeys copy]autorelease])if(![order containsObject:ID]){[_stackViews[ID]removeFromSuperview];[_stackViews removeObjectForKey:ID];}
[_stackOrder release];_stackOrder=[order copy];[_stackRoots release];_stackRoots=[roots copy];[document release];[self setNeedsLayout:YES];
[_stackOrder release];_stackOrder=[order copy];[_stackRoots release];_stackRoots=[roots copy];[self setNeedsLayout:YES];
}
- (void)toolMask:(NSButton*)sender{if(sender.tag<0||sender.tag>=_cards.count)return;id host=_embedded?[(DYToolManager*)_manager host]:_manager;NSString *node=_embedded?[(DYToolManager*)_manager nodeID]:[@"base:" stringByAppendingString:_cards[sender.tag][@"section"][@"key"]];[NSNotificationCenter.defaultCenter postNotificationName:@"DYWorkspaceToolSelection" object:host userInfo:@{@"node":node,@"source":@"inspector"}];[(DYToolMaskPanel*)_cards[sender.tag][@"maskPanel"]addMenu:sender];}
- (void)repeatTool:(NSButton*)sender{
+16 -9
查看文件
@@ -9,8 +9,9 @@
for(NSDictionary *m in groups[type]){if(![m[@"enabled"]boolValue])continue;DYToolMaskEntry entry{};entry.section=(int)section;entry.combine=[m[@"combine"]intValue];[m[@"parameters"]getBytes:&entry.mask.parameters length:sizeof(DYMaskParameters)];entry.mask.parameters.imageAspect=w/ht;NSData *nodes=m[@"nodes"];entry.mask.path=dyFlattenMask((const DYBezierNode*)nodes.bytes,nodes.length/sizeof(DYBezierNode));entries.push_back(entry);}
}if(_faceEntries.length){const DYToolMaskEntry *faces=(const DYToolMaskEntry*)_faceEntries.bytes;entries.insert(entries.end(),faces,faces+_faceEntries.length/sizeof(DYToolMaskEntry));}h->count=(unsigned)entries.size();if(entries.empty())entries.push_back({});return [[device newBufferWithBytes:entries.data() length:entries.size()*sizeof(DYToolMaskEntry) options:MTLResourceStorageModeShared]autorelease];
}
- (void)encodeBlend:(id<MTLTexture>)before after:(id<MTLTexture>)after output:(id<MTLTexture>)output masks:(id<MTLBuffer>)masks header:(DYToolMaskHeader)h entry:(NSDictionary*)entry commands:(id<MTLCommandBuffer>)commands {
id<MTLComputeCommandEncoder>encoder=[commands computeCommandEncoder];[encoder setComputePipelineState:entry[@"dyToolBlend"]];[encoder setTexture:before atIndex:0];[encoder setTexture:after atIndex:1];[encoder setTexture:output atIndex:2];[encoder setBuffer:masks offset:0 atIndex:0];[encoder setBytes:&h length:sizeof(h) atIndex:1];[encoder dispatchThreads:MTLSizeMake(output.width,output.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[encoder endEncoding];
- (BOOL)encodeBlend:(id<MTLTexture>)before after:(id<MTLTexture>)after output:(id<MTLTexture>)output masks:(id<MTLBuffer>)masks header:(DYToolMaskHeader)h entry:(NSMutableDictionary*)entry commands:(id<MTLCommandBuffer>)commands error:(NSError**)error {
id<MTLComputePipelineState> pipeline=[self computePipeline:@"dyToolBlend" entry:entry error:error];if(!pipeline)return NO;
id<MTLComputeCommandEncoder>encoder=[commands computeCommandEncoder];[encoder setComputePipelineState:pipeline];[encoder setTexture:before atIndex:0];[encoder setTexture:after atIndex:1];[encoder setTexture:output atIndex:2];[encoder setBuffer:masks offset:0 atIndex:0];[encoder setBytes:&h length:sizeof(h) atIndex:1];[encoder dispatchThreads:MTLSizeMake(output.width,output.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[encoder endEncoding];return YES;
}
- (BOOL)copyTile:(FxImageTile*)source to:(FxImageTile*)dest entry:(NSMutableDictionary*)e error:(NSError**)error {
return [self copyTile:source to:dest rotation:0 entry:e error:error];
@@ -34,7 +35,7 @@
if(source.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)vertex.textureCoordinate.y=1-vertex.textureCoordinate.y;
if(dest.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)vertex.position.y=-vertex.position.y;
}
vector_uint2 size={(unsigned)b.width,(unsigned)b.height};id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];MTLRenderPassDescriptor *pass=[MTLRenderPassDescriptor renderPassDescriptor];pass.colorAttachments[0].texture=b;pass.colorAttachments[0].loadAction=MTLLoadActionDontCare;pass.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>encoder=[cb renderCommandEncoderWithDescriptor:pass];[encoder setRenderPipelineState:pipeline];[encoder setVertexBytes:v length:sizeof(v) atIndex:0];[encoder setVertexBytes:&size length:sizeof(size) atIndex:1];[encoder setFragmentTexture:a atIndex:0];[encoder drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[encoder endEncoding];[cb commit];[cb waitUntilCompleted];return cb.status==MTLCommandBufferStatusCompleted?YES:fail(error,cb.error.localizedDescription);
vector_uint2 size={(unsigned)b.width,(unsigned)b.height};id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];MTLRenderPassDescriptor *pass=[MTLRenderPassDescriptor renderPassDescriptor];pass.colorAttachments[0].texture=b;pass.colorAttachments[0].loadAction=MTLLoadActionDontCare;pass.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>encoder=[cb renderCommandEncoderWithDescriptor:pass];[encoder setRenderPipelineState:pipeline];[encoder setVertexBytes:v length:sizeof(v) atIndex:0];[encoder setVertexBytes:&size length:sizeof(size) atIndex:1];[encoder setFragmentTexture:a atIndex:0];[encoder drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[encoder endEncoding];return [self completeCommands:cb destination:dest texture:b entry:e]?YES:fail(error,cb.error.localizedDescription);
}
// Extra skin keeps the source reference used by the prior release. All other
// extra tools reuse the same isolated native tool path and their own mask group.
@@ -50,22 +51,28 @@
if([type isEqual:@"mixer"]||[type isEqual:@"film"]){layer.filmFrameKey=[node[@"filmFrameKey"]unsignedIntValue];return [self renderFilmTool:type source:source destination:destination uniforms:layer masks:node[@"masks"] entry:entry error:error];}
if(![type isEqual:@"skin"])return [self renderLegacy:source destination:destination uniforms:layer paths:node[@"paths"] spider:node[@"spider"] masks:@{type:node[@"masks"]} error:error];
id<MTLDevice>d=entry[@"device"];id<MTLTexture>before=[source metalTextureForDevice:d],input=[original metalTextureForDevice:d],after=[destination metalTextureForDevice:d];
id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:entry[@"dyToolSkin"]];[ce setTexture:before atIndex:0];[ce setTexture:input atIndex:1];[ce setTexture:after atIndex:2];[ce setBytes:&layer length:sizeof(layer) atIndex:0];[ce dispatchThreads:MTLSizeMake(after.width,after.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);
id<MTLComputePipelineState> pipeline=[self computePipeline:@"dyToolSkin" entry:entry error:error];if(!pipeline)return NO;
id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:pipeline];[ce setTexture:before atIndex:0];[ce setTexture:input atIndex:1];[ce setTexture:after atIndex:2];[ce setBytes:&layer length:sizeof(layer) atIndex:0];[ce dispatchThreads:MTLSizeMake(after.width,after.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);
if(![node[@"masks"]count]&&layer.skinFaceOnly<.5&&layer.skinVisualize<.5)return YES;
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:after.width height:after.height mipmapped:NO];desc.storageMode=MTLStorageModePrivate;desc.usage=MTLTextureUsageRenderTarget|MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;id<MTLTexture>blend=[d newTextureWithDescriptor:desc];if(!blend)return fail(error,@"无法分配新增工具蒙版缓冲区");
DYToolMaskHeader h{};h.section=3;h.faceOnly=layer.skinFaceOnly>.5;h.skinPreview=layer.skinProtection.x>.5&&layer.skinVisualize>.5;id<MTLBuffer>buffer=[self maskBuffer:@{type:node[@"masks"]} tile:source device:d header:&h];cb=[entry[@"queue"]commandBuffer];[self encodeBlend:before after:after output:blend masks:buffer header:h entry:entry commands:cb];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
DYToolMaskHeader h{};h.section=3;h.faceOnly=layer.skinFaceOnly>.5;h.skinPreview=layer.skinProtection.x>.5&&layer.skinVisualize>.5;id<MTLBuffer>buffer=[self maskBuffer:@{type:node[@"masks"]} tile:source device:d header:&h];cb=[entry[@"queue"]commandBuffer];if(![self encodeBlend:before after:after output:blend masks:buffer header:h entry:entry commands:cb error:error]){[blend release];return NO;}[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
DYExportTile *blended=[[DYExportTile alloc]initWithTexture:blend registry:d.registryID];[blended setBounds:source.tilePixelBounds origin:source.imageOrigin];[blended setPixelAspect:source.pixelAspect];[blend release];if(ok)ok=[self copyTile:blended to:destination entry:entry error:error];else fail(error,cb.error.localizedDescription);[blended release];return ok;
}
- (BOOL)renderToolsSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools error:(NSError**)error {@synchronized(self){return DYRenderWithPool(error,[&]()->BOOL{
if(!tools)tools=@{@"schema":@1,@"layers":@[],@"baseMasks":@{}};if(!DYValidToolDocument(tools))return fail(error,@"工具或蒙版数据损坏,未更改原工程");
if(tools[@"sharedMasks"])tools=DYResolvedToolDocument(tools);
DYApplyRemovedBaseTools(&u,tools);paths=DYVisibleBaseToolPaths(paths,tools);if(DYBaseToolRemoved(tools,@"spider"))spider=nil;
NSArray *layers=tools[@"layers"];BOOL active=NO,anchored=NO;for(NSDictionary *node in layers)if(!DYToolIsNeutral(node)){active=YES;anchored|=![DYToolRootAnchor(tools,node[@"id"])isEqual:@"tail"];}
NSMutableSet *activeIDs=nil;BOOL anchored=NO;
for(NSDictionary *node in tools[@"layers"])if(!DYToolIsNeutral(node)){
if(!activeIDs)activeIDs=[NSMutableSet set];
[activeIDs addObject:node[@"id"]];
anchored|=![DYToolRootAnchor(tools,node[@"id"])isEqual:@"tail"];
}
// No active extra tool keeps the exact historical fused path, including HDR.
if(!active&&!DYChannelMixerActive(u)&&!DYFilmToolActive(u)&&(u.lensSectionEnabled<.5||(u.lensStrength==0&&u.lensScale==1)))return [self renderLegacy:src destination:dst uniforms:u paths:paths spider:spider masks:tools[@"baseMasks"] error:error];
if(!activeIDs.count&&!DYChannelMixerActive(u)&&!DYFilmToolActive(u)&&(u.lensSectionEnabled<.5||(u.lensStrength==0&&u.lensScale==1)))return [self renderLegacy:src destination:dst uniforms:u paths:paths spider:spider masks:tools[@"baseMasks"] error:error];
NSMutableDictionary *entry=[self device:dst.deviceRegistryID error:error];if(!entry)return NO;id<MTLDevice>d=entry[@"device"];id<MTLTexture>input=[src metalTextureForDevice:d];if(!input)return fail(error,@"宿主图像纹理不可用");
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:input.width height:input.height mipmapped:NO];desc.storageMode=MTLStorageModePrivate;desc.usage=MTLTextureUsageRenderTarget|MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;
DYExportTile *tile=nil,*skinReference=nil,*originalReference=nil;NSArray *order=DYToolDisplayOrder(tools);NSMutableDictionary *groups=[NSMutableDictionary dictionary];for(NSString *ID in order){NSDictionary *node=DYToolWithID(tools,ID);if(!node||DYToolIsNeutral(node))continue;NSString *root=DYToolRootAnchor(tools,ID);if(!groups[root])groups[root]=[NSMutableArray array];[groups[root]addObject:node];}
DYExportTile *tile=nil,*skinReference=nil,*originalReference=nil;NSArray *order=DYToolDisplayOrder(tools);NSMutableDictionary *groups=[NSMutableDictionary dictionary];for(NSString *ID in order){if(![activeIDs containsObject:ID])continue;NSDictionary *node=DYToolWithID(tools,ID);NSString *root=DYToolRootAnchor(tools,ID);if(!groups[root])groups[root]=[NSMutableArray array];[groups[root]addObject:node];}
auto makeTile=[&](){id<MTLTexture>texture=[d newTextureWithDescriptor:desc];if(!texture)return (DYExportTile*)nil;DYExportTile *result=[[DYExportTile alloc]initWithTexture:texture registry:d.registryID];[result setBounds:src.tilePixelBounds origin:src.imageOrigin];[result setPixelAspect:src.pixelAspect];[texture release];return result;};
auto replace=[&](DYExportTile *next){[tile release];tile=next;};
auto apply=[&](NSString *anchor){for(NSDictionary *node in groups[anchor]){if(!DYRenderWithPool(error,[&]()->BOOL{DYExportTile *next=makeTile();if(!next)return fail(error,@"无法分配新增工具缓冲区");BOOL ok=[self renderExtraTool:node source:tile original:src destination:next entry:entry error:error];if(!ok){[next release];return NO;}replace(next);return YES;}))return NO;}return YES;};
@@ -99,7 +106,7 @@
if(branch==0)bwTile=[tile retain];
}
DYExportTile *mixed=makeTile();if(!mixed)return fail(error,@"无法分配黑白混合缓冲区");DYToolMaskEntry constant{};constant.section=0;constant.combine=0;constant.mask.parameters=dyDefaultMaskParameters();constant.mask.parameters.kind=DYMaskRectangle;constant.mask.parameters.width=constant.mask.parameters.height=4000;constant.mask.parameters.feather=0;constant.mask.parameters.outputBlack=constant.mask.parameters.outputWhite=1;constant.mask.parameters.strength=bwMix;
id<MTLBuffer>weight=[[d newBufferWithBytes:&constant length:sizeof(constant) options:MTLResourceStorageModeShared]autorelease];if(!weight){[mixed release];return fail(error,@"无法分配黑白混合权重");}DYToolMaskHeader h{};h.count=1;h.section=0;h.premultiplied=1;h.scaleX=h.scaleY=1;id<MTLCommandBuffer>commands=[entry[@"queue"]commandBuffer];[self encodeBlend:[tile metalTextureForDevice:d] after:[bwTile metalTextureForDevice:d] output:[mixed metalTextureForDevice:d] masks:weight header:h entry:entry commands:commands];[commands commit];[commands waitUntilCompleted];if(commands.status!=MTLCommandBufferStatusCompleted){[mixed release];return fail(error,commands.error.localizedDescription);}replace(mixed);
id<MTLBuffer>weight=[[d newBufferWithBytes:&constant length:sizeof(constant) options:MTLResourceStorageModeShared]autorelease];if(!weight){[mixed release];return fail(error,@"无法分配黑白混合权重");}DYToolMaskHeader h{};h.count=1;h.section=0;h.premultiplied=1;h.scaleX=h.scaleY=1;id<MTLCommandBuffer>commands=[entry[@"queue"]commandBuffer];if(![self encodeBlend:[tile metalTextureForDevice:d] after:[bwTile metalTextureForDevice:d] output:[mixed metalTextureForDevice:d] masks:weight header:h entry:entry commands:commands error:error]){[mixed release];return NO;}[commands commit];[commands waitUntilCompleted];if(commands.status!=MTLCommandBufferStatusCompleted){[mixed release];return fail(error,commands.error.localizedDescription);}replace(mixed);
}@finally{[prefix release];[bwTile release];}
// An extra skin tool follows the original skin and B&W mixture once.
if(!apply(@"base:skin"))return NO;
+1 -1
查看文件
@@ -9,7 +9,7 @@
auto dispatch=[&](NSString*name,const void*params,NSUInteger length,const void*extra=nullptr,NSUInteger extraLength=0){id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配一级 CST 缓冲区。");BOOL ok=[self managedDispatch:name textures:@[current,out] data:params length:length extra:extra extraLength:extraLength entry:entry error:error];if(ok)current=out;return ok;};
auto transform=[&](CSTParams p){if(p.inputTransfer==p.outputTransfer&&p.inputGamut==p.outputGamut&&!p.toneMapping)return YES;return dispatch(@"dyPrimaryCST",&p,sizeof(p));};
auto tile=[&](id<MTLTexture>t){DYExportTile*v=[[[DYExportTile alloc]initWithTexture:t registry:d.registryID]autorelease];[v setBounds:src.tilePixelBounds origin:src.imageOrigin];[v setPixelAspect:src.pixelAspect];return v;};
auto blend=[&](id<MTLTexture>before,NSArray*masks,float amount,NSString*type){if(!masks.count&&amount>=1)return YES;id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配一级混合缓冲区。");DYToolMaskHeader h{};id<MTLBuffer>mb=[self maskBuffer:@{type:masks?:@[]} tile:src device:d header:&h];h.section=(int)[DYToolTypes()indexOfObject:type];struct {CSTParams toLinear,fromLinear,originalTo709;float amount;}p={{wg,wt,2,20,0},{2,20,wg,wt,0},{initialGamut,initialTransfer,22,20,0},amount};id<MTLComputePipelineState>pipeline=[self managedKernel:@"dyUnifiedBlend" entry:entry error:error];if(!pipeline||!mb)return NO;id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:pipeline];[ce setTexture:before atIndex:0];[ce setTexture:current atIndex:1];[ce setTexture:out atIndex:2];[ce setTexture:originalWorking?:before atIndex:3];[ce setBuffer:mb offset:0 atIndex:0];[ce setBytes:&h length:sizeof(h) atIndex:1];[ce setBytes:&p length:sizeof(p) atIndex:2];[ce dispatchThreads:MTLSizeMake(source.width,source.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);current=out;return YES;};
auto blend=[&](id<MTLTexture>before,NSArray*masks,float amount,NSString*type){if(!masks.count&&amount>=1)return YES;id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配一级混合缓冲区。");DYToolMaskHeader h{};id<MTLBuffer>mb=[self maskBuffer:@{type:masks?:@[]} tile:src device:d header:&h];h.section=(int)[DYToolTypes()indexOfObject:type];struct {CSTParams toLinear,fromLinear,originalTo709;float amount;}p={{wg,wt,2,20,0},{2,20,wg,wt,0},{initialGamut,initialTransfer,22,20,0},amount};id<MTLComputePipelineState>pipeline=[self computePipeline:@"dyUnifiedBlend" entry:entry error:error];if(!pipeline||!mb)return NO;id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:pipeline];[ce setTexture:before atIndex:0];[ce setTexture:current atIndex:1];[ce setTexture:out atIndex:2];[ce setTexture:originalWorking?:before atIndex:3];[ce setBuffer:mb offset:0 atIndex:0];[ce setBytes:&h length:sizeof(h) atIndex:1];[ce setBytes:&p length:sizeof(p) atIndex:2];[ce dispatchThreads:MTLSizeMake(source.width,source.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);current=out;return YES;};
auto grade=[&](DYUniforms values,NSArray*masks,BOOL local){if(values.primarySectionEnabled<.5||values.cm.mix<=0)return YES;DYUniforms neutral=values;neutral.inputSectionEnabled=neutral.cm.outputEnabled=0;BOOL gradeNeutral=identityCM(neutral);if(!local&&gradeNeutral)return YES;if(local&&identityCM(values))return YES;
DayuRenderParams p=DYCMRender(values.cm);p.input.toneMapping=0;if((int)lroundf(values.cm.workingTransfer)==20){p.reserved|=8;p.basis.colorspace=10;p.basisInput={(int)lroundf(values.cm.workingGamut),20,(int)lroundf(values.cm.workingGamut),10,0};p.basisOutput={(int)lroundf(values.cm.workingGamut),10,(int)lroundf(values.cm.workingGamut),20,0};}CSTParams back={wg,wt,wg,wt,0};
if(local){p.stages=(values.inputSectionEnabled>.5?1:0)|(gradeNeutral?0:2)|(values.cm.outputEnabled>.5?4:0);back={values.cm.outputEnabled>.5?(int)lroundf(values.cm.outputGamut):(int)lroundf(values.cm.workingGamut),values.cm.outputEnabled>.5?(int)lroundf(values.cm.outputTransfer):(int)lroundf(values.cm.workingTransfer),wg,wt,0};}
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.20.2</string>
<string>1.21.0</string>
<key>CFBundleVersion</key>
<string>113</string>
<string>114</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>PlugInKit</key>
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.20.2</string>
<string>1.21.0</string>
<key>CFBundleVersion</key>
<string>113</string>
<string>114</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
+38 -2
查看文件
@@ -2,15 +2,51 @@
更新于 2026-11-08(Asia/Shanghai)。这是新对话的接手入口。历史设计和实现细节按需查阅专项交接,复现和交付证据以对应版本的报告为准。
## 1.21.0(114)流畅性优化
按首帧、连续渲染和检查器刷新优化。Metal 管线首次使用才创建,中性画面跳过通用调色与查找纹理,保留原来的半精度透明度规则;无蒙版 CST 将解除预乘并入原转换内核。最终画面取样合并进输出命令并复用小缓冲,仍保留暂停帧的示波器样本。检查器复用本轮的宿主读参和工具文档,只在切换色彩管理模式时移动输出控件。胶片颗粒未参与时省去宿主帧时序查询。
正式 1.21.0(114)已在唯一 FxPlug 路径安装,编译提交 `90e512aabe72fff30046b4bf18d6a35f91c0c113`。APP 公证 `505ed5a4-7b32-49a2-8eef-70c7757a98b4` Accepted,正式版 1050 项原生检查通过,包括 21 组独立 CST 参考。FCP 12.4 的独立验收副本从 00:00:00:00 播到 00:00:11:09,检查器和工作区混合滑杆均写入 0.50 后复位至 1.00,四种示波器回读 57,600 个有效 sRGB 样本。首次打开时请求时间与缓存帧不一致,下一次实际渲染后显示;同帧重开、宿主撤销、拖动延迟、掉帧、Motion 与完整导出未确认。[安装](verification/Delivery1.21.0.json) · [宿主](verification/HostFluidity1.21.0.json)
M4 两组交错顺序的渲染加隐藏取样基准,1080p 中性 HSL 从 2.10–2.33 降到 1.39–1.62 ms,4K 加基础曝光从 19.15–19.69 降到 14.91–15.03 ms。4K 默认整合版中位数跨运行从 17.47–23.04 到 15.13–19.29 ms,存在重叠。每组的六个末帧及对应示波器样本均与 113 逐字节一致。默认整合版计算管线从 16 套降到 3 套。全尺寸中间纹理按帧释放,小型示波器缓冲按设备复用。[基准](verification/Fluidity1.21.0.json)
PKG 公证 `29d5f921-6cd4-48a4-856a-2632f9a85e2b` Accepted。20 项验包、192 条载荷权限、签名及票据检查通过,44508770 字节,SHA-256 `ec1a57f23bf369d7a7841848d71d8ab78a7c229cbb5abe1c502e9964f87dbbcb`。本机通过独立正式 APP 验收,未执行包内安装脚本。[验包](verification/Package1.21.0.json)
入口为 `DYRenderer.mm`、`DYGrade.metal`、`DYScopeCapture.inc.h`、`DYPlugIn.mm` 与 `DYInspector.mm`。当前待核验发行附件下载与独立远端恢复。用户有新卡顿反馈时,先记录宿主、分辨率、发生阶段和启用的实际工具,再用正式安装路径复测。
## 2026-11-08 默认参数渲染排查
核对正式安装 1.20.2(113)、编译提交 `046411ba8b2c2bf8549601b2e5a080fd9dccd31b`。整合版、HSL、一级调色和 CST 独立效果的已安装模板、APP 内置模板和源码逐字节一致。整合模板没有额外工具层、LUT 或变形网格,默认执行 Sony S-Log3 / S-Gamut3.Cine 到 Gamma 2.4 / Rec.709 的 CST,自动色调映射开启。独立 HSL 的工具文档移除了一级调色。
- **模块执行**:`bypassNeutralTools` 跳过默认曲线、HSL、颜色分级、三原色、色阶和色彩平衡。空 LUT、零混合黑白、中性蜘蛛盘、通道混合器、胶片和畸变也不会因眼睛开启而各自运行。`DYToolIsNeutral` 过滤默认的独立工具层。本次对照均未触发 Vision 人脸检测。[渲染入口](大鱼调色/Plugin/DYRenderer.mm#L66) · [工具调度](大鱼调色/Plugin/DYToolRender.inc.h#L59)
- **首帧准备**:首次创建设备资源会初始化 16 套计算管线,包括尚未使用的畸变、图章和胶片。融合渲染仍获取白平衡、HSL、分级三张查找纹理,每个新渲染器的中性状态也会创建 33³ 纹理。已确认准备工作存在,未单独计量各项耗时。[设备准备](大鱼调色/Plugin/DYRenderer.mm#L188) · [查找纹理](大鱼调色/Plugin/DYColorTables.mm#L229)
- **每帧剩余工作**:整帧无有效调色时仍分配中间纹理,解除预乘并运行融合着色器,没有整帧直通。输出回调在示波器关闭时也同步读取 320×180 画面以保留同帧缓存,供工作区或蜘蛛盘打开时立即取样。[融合渲染](大鱼调色/Plugin/DYRenderer.mm#L248) · [输出取样](大鱼调色/Plugin/DYScopeCapture.inc.h#L83)
Mac mini M4 无界面基准复用正式 113 的 Release 对象和安装资源,按安装模板的参数与归档构造状态,用逐帧变化的 RGBA16Float 合成渐变,每组跳过首 5 帧,取 12 帧中位数。渲染与隐藏示波器读回分别计时。
| 对照 | 1080p 渲染 | 4K 渲染 |
| --- | ---: | ---: |
| 整合模板默认 | 5.12 ms | 16.42 ms |
| 整合模板保留一级调色,其余眼睛关闭 | 4.62 ms | 16.30 ms |
| 整合模板只关闭一级调色 | 1.72 ms | 4.71 ms |
| 独立 HSL 默认 | 1.70 ms | 4.66 ms |
| 仅用现有 GPU 图像复制函数 | 0.73 ms | 2.09 ms |
保留一级调色的两组在末帧逐像素一致。只关一级、独立 HSL 和复制对照的末帧与输入一致。整合默认状态隐藏示波器另耗约 0.68 ms(1080p)和 0.65 ms(4K)。正式安装服务的 980 项基础自检通过,覆盖默认状态无 Vision、无多边形蒙版管线和关闭示波器时缓存最后一帧。以上是渲染器及读回耗时,未测宿主参数桥、解码、播放调度、掉帧或交互延迟,也未操作用户工程。
本轮仅记录排查,未修改运行代码、模板或安装。接手优化时先以中性独立 HSL 验证整帧直通,并单独计量首帧管线准备与隐藏示波器取样。复核 HDR、负值、透明度、坐标原点以及同帧示波器取样,保留默认 CST 的实际输出。既有工程文件的 Security 引用排序差异留在工作区。
## 1.20.2(113)蜘蛛盘示波器
用户实看 1.20.0 后指出轨迹盖过控制网、肤色线与控制面板方向不同。1.20.1 将两处统一到同一份最终输出的色彩转换、Cb/Cr 取样、比例和肤色线方向。蜘蛛盘显示坐标同步投影,底层保留 HSV 网格和预设,拖动与方向键反向映射回原坐标。参照用户配图改为暗中性中心、平滑色相外圈、受限的轨迹透明度、灰色节点与深色描边。1.20.2 按用户追加反馈把网格前景线的白色不透明度由 55% 提至 72%,保留深色底描边。
新 FCP 整合效果、独立模板和新插入的肤色工具默认关闭保护。FCP 模板显式写入关闭值,注册默认保留历史开启值,兼容省略该参数的旧片段。Motion 直接添加原生滤镜沿用注册默认。显式开启时保护程度默认 60,仅保护人脸默认开启。
1.20.0(111)与 1.20.1(112)均为本轮正式签名公证的验收候选。1.20.1 安装后通过 1002 项原生检查,在 FCP 实片同帧并排核实两个矢量示波器方向及肤色保护关闭。两版均未发布 Release。[111 实看](verification/HostSpiderScope1.20.0.json) · [112 实看](verification/HostSpiderScope1.20.1.json) · [112 安装](verification/Delivery1.20.1.json)。最终 **1.20.2(113)已公证安装并在 FCP 12.4 同帧实看**。1002 项原生检查通过,17 套模板静态校验通过。实际编译提交 `046411ba8b2c2bf8549601b2e5a080fd9dccd31b`,APP 公证 `e8c27c08-a78e-4be2-9adf-235e7bfad1f6` Accepted,固定插件路径 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。同一帧确认网格提亮后仍能看清色度轨迹,两处肤色线均朝左上,检查器肤色保护为关闭。[实片核验](verification/HostSpiderScope1.20.2.json) · [安装](verification/Delivery1.20.2.json)。
1.20.0(111)与 1.20.1(112)均为本轮正式签名公证的验收候选。1.20.1 安装后通过 1002 项原生检查,在 FCP 实片同帧并排核实两个矢量示波器方向及肤色保护关闭。两版均为本机验收候选。[111 实看](verification/HostSpiderScope1.20.0.json) · [112 实看](verification/HostSpiderScope1.20.1.json) · [112 安装](verification/Delivery1.20.1.json)。最终 **1.20.2(113)已公证安装并在 FCP 12.4 同帧实看**。1002 项原生检查通过,17 套模板静态校验通过。实际编译提交 `046411ba8b2c2bf8549601b2e5a080fd9dccd31b`,APP 公证 `e8c27c08-a78e-4be2-9adf-235e7bfad1f6` Accepted,固定插件路径 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。同一帧确认网格提亮后仍能看清色度轨迹,两处肤色线均朝左上,检查器肤色保护为关闭。[实片核验](verification/HostSpiderScope1.20.2.json) · [安装](verification/Delivery1.20.2.json)。
正式 PKG 公证 `1a6834df-840f-47da-9ee8-be6a0a808fee` Accepted,20 项展开验包、票据、Gatekeeper 与 192 条载荷权限通过。包大小 44505420 字节,SHA-256 `8edd792c6a9be629263baee68c4c3e7b67221ffd1e995bd8c9ab1f753eefd2b4`。已独立安装正式 APP,本机验收未再次运行 PKG 安装脚本。[验包](verification/Package1.20.2.json)。Git Release 附件上传及下载校验进行中。入口为 `大鱼调色/Plugin/DYSpiderScopeDrawing.h`、`DYScopeCapture.inc.h`、`DYViewerGraphics.inc.h` 和 `DYModel.mm`。既有工程文件的 Security 引用排序差异留在工作区。
正式 PKG 公证 `1a6834df-840f-47da-9ee8-be6a0a808fee` Accepted,20 项展开验包、票据、Gatekeeper 与 192 条载荷权限通过。包大小 44505420 字节,SHA-256 `8edd792c6a9be629263baee68c4c3e7b67221ffd1e995bd8c9ab1f753eefd2b4`。已独立安装正式 APP,本机验收未再次运行 PKG 安装脚本。[验包](verification/Package1.20.2.json)。Git Release **413** 的 PKG 附件 **59** 已发布,草稿浏览器及发布后均完整下载并核对大小和 SHA-256。标签 `v1.20.2-spider-scope-20261108` 指向 `bc9021271d5e4992a6a63011e4ff197812029ab3`。已独立从远端检出编译节点和发行标签,分别核对 798 与 802 个跟踪文件和 Git 完整性。[Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.20.2-spider-scope-20261108) · [发行核验](verification/Release1.20.2.json) · [恢复](verification/Recovery1.20.2.json)。
本轮两个未发布候选包、草稿下载副本、旧替换 APP、公证 ZIP 和恢复克隆已清理,保留正式包与用户原有历史发行包。[清理](verification/Cleanup1.20.2.json)。入口为 `大鱼调色/Plugin/DYSpiderScopeDrawing.h`、`DYScopeCapture.inc.h`、`DYViewerGraphics.inc.h` 和 `DYModel.mm`。既有工程文件的 Security 引用排序差异留在工作区。
## 1.19.1 交付基线(历史)