diff options
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/crt.ci.metal | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/shaders/crt.ci.metal b/shaders/crt.ci.metal index 414e9cdc..c7e91a7e 100644 --- a/shaders/crt.ci.metal +++ b/shaders/crt.ci.metal @@ -2,6 +2,13 @@ // plain tracks; the final full-window kernel ports crt.frag.glsl and combines // CRT, ripple and glitch. Scene constants and sampling geometry stay in step // with GLSL, while panel easing/noise stays in step with panel_animation.zig. +// +// The three entry points are `extern "C" [[stitchable]]`. Both halves are +// load-bearing: this source is compiled at runtime by +// CIKernel.kernels(withMetalString:), which looks for stitchable functions and +// fails the whole compile with "cannot find a valid stitchable Metal function +// in the source" if it finds none — leaving the view with no postprocessor and +// every effect silently off. #include <metal_stdlib> #include <CoreImage/CoreImage.h> using namespace metal; @@ -133,7 +140,7 @@ float pardesPanelProgress(float effect, float frame) { // Prepare every geometric target before any translated panel is drawn. A // vertical opener restores the old frame in its fixed clip; a closing pane is // already absent from `canvas` and therefore needs no clear at all. -extern "C" float4 pardesPanelClear( +extern "C" [[stitchable]] float4 pardesPanelClear( coreimage::sampler canvas, coreimage::sampler previous, float4 target, @@ -154,7 +161,7 @@ extern "C" float4 pardesPanelClear( // One panel draw over the accumulated image. Current and previous are complete // CoreText+attachment rasters. That makes a closing pane safe after its core // allocation is gone and makes ASCII/dissolve true old-to-new data effects. -extern "C" float4 pardesPanel( +extern "C" [[stitchable]] float4 pardesPanel( coreimage::sampler current, coreimage::sampler previous, coreimage::sampler changedMask, @@ -230,7 +237,7 @@ extern "C" float4 pardesPanel( : current.sample(current.transform(sourceCoord)); } -extern "C" float4 pardesScene( +extern "C" [[stitchable]] float4 pardesScene( coreimage::sampler source, float timeSeconds, float frame, |
