Use float tetrahedral input LUT interpolation after identity-LUT regression exposed hardware quantization

这个提交包含在:
mac 于 2026-11-03 12:59:18 +08:00 提交
1 父节点 9f5c9a1237
当前提交 8bd2ba91fa
2 个文件已更改
+4 -4

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

+2 -2
查看文件
@@ -19,8 +19,8 @@ kernel void dyManagedBlend(texture2d<float,access::read> before [[texture(0)]],t
}
// Explicit code-value carrier for expert camera/LUT input. Host-profile mode
// never uses this reinterpretation; it converts the actual source ICC instead.
kernel void dyManagedCarrier(texture2d<float,access::read> a [[texture(0)]],texture2d<float,access::write> b [[texture(1)]],texture3d<float> cube [[texture(2)]],constant uint& useLUT [[buffer(0)]],uint2 p [[thread_position_in_grid]]){
if(any(p>=uint2(b.get_width(),b.get_height())))return;float4 c=a.read(p);if(c.a>0){float3 v=dyEncode(c.rgb/c.a);if(useLUT){constexpr sampler s(coord::normalized,address::clamp_to_edge,filter::linear);float n=cube.get_width();v=cube.sample(s,clamp(v,0.f,1.f)*((n-1)/n)+.5f/n).rgb;}c.rgb=v*c.a;}b.write(c,p);
kernel void dyManagedCarrier(texture2d<float,access::read> a [[texture(0)]],texture2d<float,access::write> b [[texture(1)]],texture3d<float,access::read> cube [[texture(2)]],constant uint& useLUT [[buffer(0)]],uint2 p [[thread_position_in_grid]]){
if(any(p>=uint2(b.get_width(),b.get_height())))return;float4 c=a.read(p);if(c.a>0){float3 v=dyEncode(c.rgb/c.a);if(useLUT)v=dyPrintTetra(cube,v);c.rgb=v*c.a;}b.write(c,p);
}
fragment float4 dyManagedCopyFragment(DYRaster in [[stage_in]],texture2d<float> source [[texture(0)]]){constexpr sampler f(coord::normalized,address::clamp_to_edge,filter::linear);return source.sample(f,in.uv);}