authoravatarclover caruso<git@paperclover.net>2026-11-30 19:11:39-08:00
committeravatarclover caruso<git@paperclover.net>2026-11-30 19:14:04-08:00
loga9e4b2c177b6285819eb8cc1b1e92ff29b4e94d8
tree06fd230a7fc5ab9504a102a522032d20bc1fd69f
parent10c172828f801d8935b0fba75f715dda3b75e935
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Remove unused TextOutline GPU dilation shader replaced by zeno vector stroke (#35)


2 files changed, 3 insertions(+), 52 deletions(-)

crates/engine/src/eval/mod.rs+3-6
...@@ -122,7 +122,6 @@ enum ShaderOp {...@@ -122,7 +122,6 @@ enum ShaderOp {
122 VariBlur,122 VariBlur,
123 OutlineTint,123 OutlineTint,
124 OutlineComposite,124 OutlineComposite,
125 TextOutline,
126 #[allow(dead_code)]125 #[allow(dead_code)]
127 CustomWave,126 CustomWave,
128 Crop,127 Crop,
...@@ -198,7 +197,6 @@ impl ShaderOp {...@@ -198,7 +197,6 @@ impl ShaderOp {
198 | Self::FastNoise197 | Self::FastNoise
199 | Self::OutlineTint198 | Self::OutlineTint
200 | Self::OutlineComposite199 | Self::OutlineComposite
201 | Self::TextOutline
202 | Self::CustomWave200 | Self::CustomWave
203 | Self::UltraKeyer201 | Self::UltraKeyer
204 | Self::Plasma => ShaderDomain::KeyersGen,202 | Self::Plasma => ShaderDomain::KeyersGen,
...@@ -233,7 +231,6 @@ impl ShaderOp {...@@ -233,7 +231,6 @@ impl ShaderOp {
233 Self::VariBlur => "vari_blur_op",231 Self::VariBlur => "vari_blur_op",
234 Self::OutlineTint => "outline_tint",232 Self::OutlineTint => "outline_tint",
235 Self::OutlineComposite => "outline_composite",233 Self::OutlineComposite => "outline_composite",
236 Self::TextOutline => "text_outline_op",
237 Self::CustomWave => "custom_wave_op",234 Self::CustomWave => "custom_wave_op",
238 Self::Crop => "crop_op",235 Self::Crop => "crop_op",
239 Self::GlowAdd => "glow_add_op",236 Self::GlowAdd => "glow_add_op",
...@@ -1406,7 +1403,7 @@ mod lazy_shader_verify {...@@ -1406,7 +1403,7 @@ mod lazy_shader_verify {
1406 ShaderOp::FastNoise, ShaderOp::Displace, ShaderOp::MaskShape, ShaderOp::MaskCombine,1403 ShaderOp::FastNoise, ShaderOp::Displace, ShaderOp::MaskShape, ShaderOp::MaskCombine,
1407 ShaderOp::MaskApply, ShaderOp::BitmapMask, ShaderOp::Colorize, ShaderOp::ColorCurves,1404 ShaderOp::MaskApply, ShaderOp::BitmapMask, ShaderOp::Colorize, ShaderOp::ColorCurves,
1408 ShaderOp::XfChroma, ShaderOp::GamutConvert, ShaderOp::VariBlur, ShaderOp::OutlineTint,1405 ShaderOp::XfChroma, ShaderOp::GamutConvert, ShaderOp::VariBlur, ShaderOp::OutlineTint,
1409 ShaderOp::OutlineComposite, ShaderOp::TextOutline, ShaderOp::CustomWave, ShaderOp::Crop,1406 ShaderOp::OutlineComposite, ShaderOp::CustomWave, ShaderOp::Crop,
1410 ShaderOp::GlowAdd, ShaderOp::XGlowPrep, ShaderOp::XGlowAccum, ShaderOp::DisplayBlit,1407 ShaderOp::GlowAdd, ShaderOp::XGlowPrep, ShaderOp::XGlowAccum, ShaderOp::DisplayBlit,
1411 ShaderOp::Invert, ShaderOp::ChannelBoolean, ShaderOp::Filter, ShaderOp::HueCurves,1408 ShaderOp::Invert, ShaderOp::ChannelBoolean, ShaderOp::Filter, ShaderOp::HueCurves,
1412 ShaderOp::UltraKeyer, ShaderOp::Dissolve, ShaderOp::Homography, ShaderOp::ShadowComp,1409 ShaderOp::UltraKeyer, ShaderOp::Dissolve, ShaderOp::Homography, ShaderOp::ShadowComp,
...@@ -1422,9 +1419,9 @@ mod lazy_shader_verify {...@@ -1422,9 +1419,9 @@ mod lazy_shader_verify {
1422 eng.pipelines_for(BitDepth::Float16).borrow_mut().ensure_pipeline(&eng.device, op);1419 eng.pipelines_for(BitDepth::Float16).borrow_mut().ensure_pipeline(&eng.device, op);
1423 }1420 }
1424 assert_eq!(eng.pipelines.borrow().modules.len(), 7);1421 assert_eq!(eng.pipelines.borrow().modules.len(), 7);
1425 assert_eq!(eng.pipelines.borrow().pipelines.len(), 48);1422 assert_eq!(eng.pipelines.borrow().pipelines.len(), 47);
1426 assert_eq!(eng.pipelines_for(BitDepth::Float16).borrow().modules.len(), 7);1423 assert_eq!(eng.pipelines_for(BitDepth::Float16).borrow().modules.len(), 7);
1427 assert_eq!(eng.pipelines_for(BitDepth::Float16).borrow().pipelines.len(), 48);1424 assert_eq!(eng.pipelines_for(BitDepth::Float16).borrow().pipelines.len(), 47);
1428 }1425 }
14291426
1430 #[test]1427 #[test]
crates/engine/src/shaders/keyers_gen.wgsl-46
...@@ -154,52 +154,6 @@ fn outline_composite(@builtin(global_invocation_id) gid: vec3<u32>) {...@@ -154,52 +154,6 @@ fn outline_composite(@builtin(global_invocation_id) gid: vec3<u32>) {
154 store_dst(vec2<i32>(gid.xy), vec4<f32>(out_rgb, out_a));154 store_dst(vec2<i32>(gid.xy), vec4<f32>(out_rgb, out_a));
155}155}
156156
157// ============================================================================
158// 12c. TextPlus Circular Euclidean L2 Outline + Fill-Over-Outline Composite
159// p[0] = (outline_r, outline_g, outline_b, outline_a)
160// p[1] = (radius_px, 0, 0, 0)
161// ============================================================================
162@compute @workgroup_size(8, 8)
163fn text_outline_op(@builtin(global_invocation_id) gid: vec3<u32>) {
164 let dims = textureDimensions(dst_tex);
165 if (gid.x >= dims.x || gid.y >= dims.y) { return; }
166 let p = vec2<i32>(gid.xy);
167 let orig = textureLoad(src_a, p, 0);
168 if (orig.a >= 0.999) {
169 textureStore(dst_tex, p, orig);
170 return;
171 }
172
173 let radius = clamp(u.p[1].x, 0.5, 28.0);
174 let r_int = i32(ceil(radius + 0.5));
175 let r_max = radius + 0.5;
176 let r_max2 = r_max * r_max;
177 let max_p = vec2<i32>(dims) - vec2<i32>(1, 1);
178
179 var max_a = orig.a;
180 for (var dy = -r_int; dy <= r_int; dy = dy + 1) {
181 let dy2 = f32(dy * dy);
182 for (var dx = -r_int; dx <= r_int; dx = dx + 1) {
183 let d2 = f32(dx * dx) + dy2;
184 if (d2 > r_max2) { continue; }
185 let sp = p + vec2<i32>(dx, dy);
186 if (sp.x < 0 || sp.y < 0 || sp.x > max_p.x || sp.y > max_p.y) { continue; }
187 let sa = textureLoad(src_a, sp, 0).a;
188 if (sa <= 0.0) { continue; }
189 // Subpixel Euclidean SDF dilation: partial glyph edge shifts boundary by (1 - sa) px
190 // without creating a 2-pixel soft outer halo that drops into ColorGain's DarkHue band!
191 let cov = clamp(radius - 0.5 + sa - sqrt(d2), 0.0, 1.0);
192 max_a = max(max_a, cov);
193 }
194 }
195
196 let oa = max_a * u.p[0].a;
197 let outline_rgb = u.p[0].rgb * oa;
198 let out_rgb = orig.rgb + outline_rgb * (1.0 - orig.a);
199 let out_a = orig.a + oa * (1.0 - orig.a);
200 store_dst(p, vec4<f32>(out_rgb, out_a));
201}
202
203// ============================================================================157// ============================================================================
204// 13. Custom Wave Shader (matches `sin(x|y * w * n1 + n2 * n1 * w) * 0.5 + 0.5` per channel)158// 13. Custom Wave Shader (matches `sin(x|y * w * n1 + n2 * n1 * w) * 0.5 + 0.5` per channel)
205// p[0] = (n1, n2, w_ref, 0)159// p[0] = (n1, n2, w_ref, 0)