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 {
122122 VariBlur,
123123 OutlineTint,
124124 OutlineComposite,
125 TextOutline,
126125 #[allow(dead_code)]
127126 CustomWave,
128127 Crop,
......@@ -198,7 +197,6 @@ impl ShaderOp {
198197 | Self::FastNoise
199198 | Self::OutlineTint
200199 | Self::OutlineComposite
201 | Self::TextOutline
202200 | Self::CustomWave
203201 | Self::UltraKeyer
204202 | Self::Plasma => ShaderDomain::KeyersGen,
......@@ -233,7 +231,6 @@ impl ShaderOp {
233231 Self::VariBlur => "vari_blur_op",
234232 Self::OutlineTint => "outline_tint",
235233 Self::OutlineComposite => "outline_composite",
236 Self::TextOutline => "text_outline_op",
237234 Self::CustomWave => "custom_wave_op",
238235 Self::Crop => "crop_op",
239236 Self::GlowAdd => "glow_add_op",
......@@ -1406,7 +1403,7 @@ mod lazy_shader_verify {
14061403 ShaderOp::FastNoise, ShaderOp::Displace, ShaderOp::MaskShape, ShaderOp::MaskCombine,
14071404 ShaderOp::MaskApply, ShaderOp::BitmapMask, ShaderOp::Colorize, ShaderOp::ColorCurves,
14081405 ShaderOp::XfChroma, ShaderOp::GamutConvert, ShaderOp::VariBlur, ShaderOp::OutlineTint,
1409 ShaderOp::OutlineComposite, ShaderOp::TextOutline, ShaderOp::CustomWave, ShaderOp::Crop,
1406 ShaderOp::OutlineComposite, ShaderOp::CustomWave, ShaderOp::Crop,
14101407 ShaderOp::GlowAdd, ShaderOp::XGlowPrep, ShaderOp::XGlowAccum, ShaderOp::DisplayBlit,
14111408 ShaderOp::Invert, ShaderOp::ChannelBoolean, ShaderOp::Filter, ShaderOp::HueCurves,
14121409 ShaderOp::UltraKeyer, ShaderOp::Dissolve, ShaderOp::Homography, ShaderOp::ShadowComp,
......@@ -1422,9 +1419,9 @@ mod lazy_shader_verify {
14221419 eng.pipelines_for(BitDepth::Float16).borrow_mut().ensure_pipeline(&eng.device, op);
14231420 }
14241421 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);
14261423 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);
14281425 }
14291426
14301427 #[test]
crates/engine/src/shaders/keyers_gen.wgsl-46
......@@ -154,52 +154,6 @@ fn outline_composite(@builtin(global_invocation_id) gid: vec3<u32>) {
154154 store_dst(vec2<i32>(gid.xy), vec4<f32>(out_rgb, out_a));
155155}
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
203157// ============================================================================
204158// 13. Custom Wave Shader (matches `sin(x|y * w * n1 + n2 * n1 * w) * 0.5 + 0.5` per channel)
205159// p[0] = (n1, n2, w_ref, 0)