fix: import legacy-title Cube folders and verify all 26 supplied LUTs

这个提交包含在:
mac 于 2026-11-01 15:21:18 +08:00 提交
1 父节点 593aad9ecb
当前提交 497eef29fe
9 个文件已更改
+343 -25

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

+18
查看文件
@@ -249,6 +249,24 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
deadline=NSProcessInfo.processInfo.systemUptime+10;
while(!cancelledDone&&NSProcessInfo.processInfo.systemUptime<deadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
run.record(@"external-preparation-cancellation",cancelledDone&&cancellationReported);
NSString *userFolder=NSProcessInfo.processInfo.environment[@"DY_DIAGNOSTIC_LUT_FOLDER"];
if(userFolder.length){
NSUInteger userCount=0;BOOL allUserFrames=YES;
NSURL *folder=[NSURL fileURLWithPath:userFolder];
for(NSURL *file in [NSFileManager.defaultManager enumeratorAtURL:folder includingPropertiesForKeys:@[NSURLIsRegularFileKey] options:NSDirectoryEnumerationSkipsHiddenFiles errorHandler:nil]){@autoreleasepool{
NSNumber *regular=nil;[file getResourceValue:&regular forKey:NSURLIsRegularFileKey error:nil];
if(!regular.boolValue||![file.pathExtension.lowercaseString isEqual:@"cube"])continue;
__block BOOL ready=NO;__block NSError *failure=nil;
[externalRenderer prepareLUTPath:file.path completion:^(NSError *result){failure=[result retain];ready=YES;}];
double until=NSProcessInfo.processInfo.systemUptime+30;
while(!ready&&NSProcessInfo.processInfo.systemUptime<until)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
run.need([@"user-lut-preparation:" stringByAppendingString:file.lastPathComponent],ready&&!failure,@{@"error":reason(failure)});[failure release];
Pixels frame=render(run,externalRenderer,source,destination,gpu,externalUniforms,@{@"look0":file.path},[@"user-lut-render:" stringByAppendingString:file.lastPathComponent]);
Difference delta=difference(neutral,frame);BOOL good=delta.nonfinite==0;allUserFrames&=good;userCount++;
run.record([@"user-lut-finite-frame:" stringByAppendingString:file.lastPathComponent],good,measure(delta));
}}
run.record(@"user-folder-all-luts-prepared-and-rendered",userCount>0&&allUserFrames,@{@"files":@(userCount),@"sourceFolder":userFolder,@"sourceFilesModified":@NO});
}
[gpu release];
} @catch(NSException *exception) {
run.record(@"diagnostic-exception",false,@{@"exception":exception.name?:@"unknown",@"message":exception.reason?:@"unknown"});