修复 LUT 浏览器帧比例和会话内排序
这个提交包含在:
1 父节点
5c0f177bde
当前提交
b7c2e291ec
18 个文件已更改
+205
-139
没有与搜索条件相匹配的文件
+33
-18
@@ -14,7 +14,6 @@
|
||||
#import "DYColorTables.h"
|
||||
#import "DYLUTLibrary.h"
|
||||
#import "DYLUTBrowser.h"
|
||||
#include "DYLookPreview.h"
|
||||
#import "DYInspector.h"
|
||||
#import "DYTheme.h"
|
||||
#include "DYSpiderState.h"
|
||||
@@ -411,31 +410,47 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
DYRenderer *orientationRenderer=[[[DYRenderer alloc]init]autorelease];
|
||||
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:marker.data() bytesPerRow:width*8];
|
||||
error=nil;BOOL topRendered=[orientationRenderer renderSource:source destination:destination uniforms:defaults paths:@{} error:&error];
|
||||
NSData *topAnalysis=[orientationRenderer preview],*topLook=[orientationRenderer lookLUTPreview];
|
||||
bool topOrientation=topRendered&&topLook.length==320*180*16&&[topLook isEqualToData:topAnalysis];
|
||||
if(topOrientation){const float*p=(const float*)topLook.bytes;topOrientation=p[0]>p[2]&&p[(179*320)*4+2]>p[(179*320)*4];}
|
||||
run.record(@"look-preview-top-left-is-original-analysis",topOrientation,@{@"error":topRendered?@"":reason(error),@"bytes":@(topLook.length)});
|
||||
NSData *topAnalysis=[orientationRenderer preview];
|
||||
NSDictionary *topFrames=[orientationRenderer lookLUTPreviewFrames];
|
||||
NSData *topLook=topFrames[@"standard"];
|
||||
NSSize standardSize=[topFrames[@"standardSize"] sizeValue];
|
||||
bool topOrientation=topRendered&&NSEqualSizes(standardSize,NSMakeSize(320,240))&&topLook.length==320*240*16;
|
||||
if(topOrientation){const float*p=(const float*)topLook.bytes;topOrientation=p[0]>p[2]&&p[(239*320)*4+2]>p[(239*320)*4];}
|
||||
run.record(@"look-preview-standard-4-by-3-top-first",topOrientation,@{@"error":topRendered?@"":reason(error),@"size":NSStringFromSize(standardSize)});
|
||||
[orientationRenderer invalidatePreview];[source setDiagnosticImageOrigin:kFxImageOrigin_BOTTOM_LEFT];
|
||||
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:bottomFirst.data() bytesPerRow:width*8];
|
||||
error=nil;BOOL bottomRendered=[orientationRenderer renderSource:source destination:destination uniforms:defaults paths:@{} error:&error];
|
||||
NSData *bottomAnalysis=[orientationRenderer preview],*bottomLook=[orientationRenderer lookLUTPreview];
|
||||
bool bottomOrientation=bottomRendered&&bottomAnalysis.length==320*180*16&&bottomLook.length==bottomAnalysis.length;
|
||||
if(bottomOrientation){
|
||||
const float*a=(const float*)bottomAnalysis.bytes,*b=(const float*)bottomLook.bytes;
|
||||
bottomOrientation=a[2]>a[0]&&a[(179*320)*4]>a[(179*320)*4+2]&&b[0]>b[2]&&b[(179*320)*4+2]>b[(179*320)*4];
|
||||
for(NSUInteger y=0;y<180&&bottomOrientation;y++)bottomOrientation=memcmp((const uint8_t*)bottomLook.bytes+y*320*16,(const uint8_t*)bottomAnalysis.bytes+(179-y)*320*16,320*16)==0;
|
||||
}
|
||||
run.record(@"look-preview-bottom-left-flips-only-browser-rows",bottomOrientation,@{@"error":bottomRendered?@"":reason(error),@"analysisKeepsPhysicalRowOrder":@(bottomOrientation),@"all180RowsCompared":@(bottomOrientation)});
|
||||
NSData *high=[orientationRenderer lookLUTPreviewFrames][@"high"];
|
||||
bool highOrientation=high.length==DYLookPreviewHDWidth*DYLookPreviewHDHeight*16;
|
||||
NSData *bottomAnalysis=[orientationRenderer preview];
|
||||
NSDictionary *bottomFrames=[orientationRenderer lookLUTPreviewFrames];
|
||||
NSData *bottomLook=bottomFrames[@"standard"];
|
||||
bool bottomOrientation=bottomRendered&&bottomAnalysis.length==320*180*16&&topAnalysis.length==bottomAnalysis.length&&[bottomLook isEqualToData:topLook];
|
||||
for(NSUInteger y=0;y<180&&bottomOrientation;y++)
|
||||
bottomOrientation=memcmp((const uint8_t*)topAnalysis.bytes+y*320*16,(const uint8_t*)bottomAnalysis.bytes+(179-y)*320*16,320*16)==0;
|
||||
run.record(@"look-preview-bottom-left-flips-only-browser-rows",bottomOrientation,@{@"error":bottomRendered?@"":reason(error)});
|
||||
NSData *high=bottomFrames[@"high"];
|
||||
NSSize highSize=[bottomFrames[@"highSize"] sizeValue];
|
||||
bool highOrientation=NSEqualSizes(highSize,NSMakeSize(640,480))&&high.length==640*480*16;
|
||||
if(highOrientation){
|
||||
const float *p=static_cast<const float*>(high.bytes);
|
||||
const size_t bottom=(DYLookPreviewHDHeight-1)*DYLookPreviewHDWidth*4;
|
||||
const size_t bottom=(480-1)*640*4;
|
||||
highOrientation=p[0]>p[2]&&p[bottom+2]>p[bottom];
|
||||
}
|
||||
run.record(@"look-preview-hd-640x360-top-first",highOrientation,@{@"bytes":@(high.length)});
|
||||
run.record(@"look-preview-high-4-by-3-top-first",highOrientation,@{@"size":NSStringFromSize(highSize)});
|
||||
[orientationRenderer invalidatePreview];
|
||||
run.record(@"preview-invalidation-clears-analysis-and-browser",![orientationRenderer preview]&&![orientationRenderer lookLUTPreview]&&![[orientationRenderer lookLUTPreviewFrames] count]);
|
||||
run.record(@"preview-invalidation-clears-analysis-and-browser",![orientationRenderer preview]&&![[orientationRenderer lookLUTPreviewFrames] count]);
|
||||
const NSUInteger frameSizes[][4]={{64,36,320,180},{36,64,180,320},{64,64,320,320},{84,36,320,137}};
|
||||
for(const auto& size:frameSizes){
|
||||
DYDiagnosticTile *frame=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:size[0] height:size[1]]autorelease];
|
||||
DYDiagnosticTile *output=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:size[0] height:size[1]]autorelease];
|
||||
error=nil;BOOL rendered=[orientationRenderer renderSource:frame destination:output uniforms:defaults paths:@{} error:&error];
|
||||
NSDictionary *frames=[orientationRenderer lookLUTPreviewFrames];
|
||||
NSSize standard=[frames[@"standardSize"] sizeValue],hd=[frames[@"highSize"] sizeValue];
|
||||
BOOL valid=rendered&&NSEqualSizes(standard,NSMakeSize(size[2],size[3]))
|
||||
&&labs((long)hd.width-2*(long)size[2])<=1&&labs((long)hd.height-2*(long)size[3])<=1
|
||||
&&[frames[@"standard"] length]==standard.width*standard.height*16
|
||||
&&[frames[@"high"] length]==hd.width*hd.height*16;
|
||||
run.record([NSString stringWithFormat:@"look-preview-tracks-frame-%lux%lu",(unsigned long)size[0],(unsigned long)size[1]],valid,@{@"standard":NSStringFromSize(standard),@"high":NSStringFromSize(hd),@"error":reason(error)});
|
||||
}
|
||||
[source setDiagnosticImageOrigin:kFxImageOrigin_TOP_LEFT];
|
||||
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
|
||||
DYUniforms cstExport=defaults;cstExport.cm.configured=1;cstExport.cm.exposure=.7f;
|
||||
|
||||
在新工单中引用
屏蔽一个用户