perf: bound preview memory and reuse layer admission

这个提交包含在:
mac 于 2026-11-08 16:15:11 +08:00 提交
1 父节点 c2c71f3dbc
当前提交 90e512aabe
2 个文件已更改
+9 -8

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

+1 -5
查看文件
@@ -309,11 +309,7 @@ struct DYScopeReadback {
if(!direct){
MTLTextureDescriptor *td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:input.width height:input.height mipmapped:NO];
td.storageMode=MTLStorageModePrivate;td.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;
straight=segmented?nil:e[@"legacyStraight"];
if(straight.width!=input.width||straight.height!=input.height){
straight=[[d newTextureWithDescriptor:td]autorelease];
if(straight&&!segmented)e[@"legacyStraight"]=straight;
}
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;