fix: preserve native reference and partial black-white branches for anchored layers; pass 281 native integration checks

这个提交包含在:
mac 于 2026-11-01 23:23:52 +08:00 提交
1 父节点 0b53fdcdfd
当前提交 7bac613f4a
15 个文件已更改
+129 -32

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

+9 -6
查看文件
@@ -23,7 +23,7 @@ extern "C" half4 dy_gradeSegment(half4 sample, float2 uv, texture2d<half> source
texture3d<float> look3, texture3d<float> look4, texture3d<float> look5,
texture3d<float> hslMixer, texture3d<float> whiteBalance,
texture3d<float> colorGrading, constant DYUniforms& uniforms,
constant float& sceneLevel,float w0,float w1,float w2,float w3,float w4,float w5,float w6,float w7,float w8,float w9,float w10,float w11,uint stageFirst,uint stageLast,float3 skinReference);
constant float& sceneLevel,float w0,float w1,float w2,float w3,float w4,float w5,float w6,float w7,float w8,float w9,float w10,float w11,uint stageFirst,uint stageLast,float3 skinReference,float3 originalReference);
struct DYRaster {
float4 position [[position]];
@@ -207,18 +207,21 @@ fragment half4 dySegmentFragment(DYRaster in [[stage_in]],
device const DYToolMaskEntry* masks [[buffer(6)]],
constant DYToolMaskHeader& maskHeader [[buffer(7)]],
constant DYToolStageRange& stages [[buffer(8)]],
texture2d<half> skinReference [[texture(10)]]) {
texture2d<half> skinReference [[texture(10)]],
texture2d<half> nativeSource [[texture(11)]]) {
constexpr sampler sampleFilter(coord::normalized, address::clamp_to_edge, filter::linear);
half4 sample = source.sample(sampleFilter, in.uv);
if (!(sample.a > half(0.0))) return half4(0.0h);
float weights[12];float3 encoded=dyToolEncode(float3(sample.rgb));
half4 originalSample=nativeSource.sample(sampleFilter,in.uv);
float weights[12];float3 encoded=dyToolEncode(float3(originalSample.rgb));
for(int i=0;i<12;i++)weights[i]=dyToolCoverage(in.uv,encoded,masks,maskHeader,i);
if(stages.suppressBlackWhite)weights[10]=0;
half4 reference=skinReference.sample(sampleFilter,in.uv);
float3 skinEncoded=dyToolEncode(reference.a>half(0)?float3(reference.rgb/reference.a):float3(0));
half4 result = dy_gradeSegment(sample, in.uv, source, preLUT, look1, look2, look3,
look4, look5, hslMixer, whiteBalance, colorGrading, uniforms, sceneLevel,weights[0],weights[1],weights[2],weights[3],weights[4],weights[5],weights[6],weights[7],weights[8],weights[9],weights[10],weights[11],uint(stages.first),uint(stages.last),skinEncoded);
half4 result = dy_gradeSegment(sample, in.uv, nativeSource, preLUT, look1, look2, look3,
look4, look5, hslMixer, whiteBalance, colorGrading, uniforms, sceneLevel,weights[0],weights[1],weights[2],weights[3],weights[4],weights[5],weights[6],weights[7],weights[8],weights[9],weights[10],weights[11],uint(stages.first),uint(stages.last),skinEncoded,encoded);
if(stages.first<=9 && stages.last>=9 && options.blackWhiteMix>0.0f && options.blackWhiteMix<1.0f) {
half4 color=dy_gradeSegment(sample,in.uv,source,preLUT,look1,look2,look3,look4,look5,hslMixer,whiteBalance,colorGrading,colorUniforms,sceneLevel,weights[0],weights[1],weights[2],weights[3],weights[4],weights[5],weights[6],weights[7],weights[8],weights[9],weights[10],weights[11],uint(stages.first),uint(stages.last),skinEncoded);
half4 color=dy_gradeSegment(sample,in.uv,nativeSource,preLUT,look1,look2,look3,look4,look5,hslMixer,whiteBalance,colorGrading,colorUniforms,sceneLevel,weights[0],weights[1],weights[2],weights[3],weights[4],weights[5],weights[6],weights[7],weights[8],weights[9],weights[10],weights[11],uint(stages.first),uint(stages.last),skinEncoded,encoded);
result.rgb=mix(color.rgb,result.rgb,half(options.blackWhiteMix));
}
result.a = sample.a;