# VectorScale shader preset
# Works with any input resolution (not just Game Boy 160x144).
# Intermediate textures are over-allocated using source-relative scales:
#   Cell graph:   2W x 7H   (needs (W+1) x 6(H+1), works for H >= 6)
#   Positions:    2W x 3.5H (needs (W+1) x 2(H+1), works for H >= 2)
#   PackedPositions: 6W x 3.5H (3 horizontally-adjacent texels per CP slot)
#
# Framebuffer formats are set per-shader via `#pragma format` (FP32 for
# position-storing passes). DO NOT add `float_framebuffer<N> = true` here
# — it forces RGBA16F on some backends and silently overrides the pragma,
# causing sub-pixel position rounding visible as hairline misalignment
# at the rasterizer.
shaders = 12

shader0 = shaders/similarity-graph.slang
alias0 = SimilarityGraph
filter_linear0 = false
scale_type0 = source
scale0 = 2.0
wrap_mode0 = clamp_to_border

shader1 = shaders/resolve-crossings.slang
alias1 = ResolvedGraph
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
wrap_mode1 = clamp_to_border

shader2 = shaders/cell-graph.slang
alias2 = CellGraph
filter_linear2 = false
scale_type_x2 = source
scale_x2 = 1.0
scale_type_y2 = source
scale_y2 = 3.5
wrap_mode2 = clamp_to_border

shader3 = shaders/init-positions.slang
alias3 = InitPos
filter_linear3 = false
scale_type_x3 = source
scale_x3 = 1.0
scale_type_y3 = source
scale_y3 = 0.5
wrap_mode3 = clamp_to_border

shader4 = shaders/optimize-energy.slang
alias4 = Opt1
filter_linear4 = false
scale_type4 = source
scale4 = 1.0
wrap_mode4 = clamp_to_border

shader5 = shaders/optimize-energy.slang
alias5 = Opt2
filter_linear5 = false
scale_type5 = source
scale5 = 1.0
wrap_mode5 = clamp_to_border

# T-junction stem CP snap (3 iterations for convergence). Only stem CPs
# are repositioned here — through-CPs and crossings pass through with
# their optimizer-final positions intact. The crossing curve-curve
# intersection is handled in pack-positions below.
shader6 = shaders/update-tjunction.slang
alias6 = TJunc1
filter_linear6 = false
scale_type6 = source
scale6 = 1.0
wrap_mode6 = clamp_to_border

shader7 = shaders/update-tjunction.slang
alias7 = TJunc2
filter_linear7 = false
scale_type7 = source
scale7 = 1.0
wrap_mode7 = clamp_to_border

shader8 = shaders/update-tjunction.slang
alias8 = FinalPositions
filter_linear8 = false
scale_type8 = source
scale8 = 1.0
wrap_mode8 = clamp_to_border

# Denormalize per-CP geometry: pack each CP's (pp, cp, np) ghost-extended
# triple, t_branch, neighbor indices, validity, and is_line flag into 3
# horizontally-adjacent texels of PackedPositions. For IS_CROSSING CPs,
# t_branch is the curve-curve intersection parameter (Newton iteration on
# the two B-spline spans, inlined). Lets the rasterizer skip
# neighbor-index decode + neighbor position fetches + ghost construction
# + cubic/Newton solves in its hot loop.
shader9 = shaders/pack-positions.slang
alias9 = PackedPositions
filter_linear9 = false
scale_type_x9 = source
scale_x9 = 3.0
scale_type_y9 = source
scale_y9 = 1.0
wrap_mode9 = clamp_to_border

shader10 = shaders/cell-rasterizer-single-aa.slang
alias10 = SingleAA
filter_linear10 = false
scale_type10 = viewport
scale10 = 1.0
wrap_mode10 = clamp_to_border

shader11 = shaders/cell-rasterizer-multi-aa.slang
alias11 = FinalOutput
filter_linear11 = true
scale_type11 = viewport
scale11 = 1.0
wrap_mode11 = clamp_to_border
