From 8b970cbebf03d952da363805de0f661e5197045f Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 3 Oct 2026 13:40:16 +0200 Subject: [PATCH] CultMath tools: compile-glsl.ps1 -Phacelle concatenates CultMath.Phacelle.glsl after the library Co-Authored-By: Claude Opus 5.5 --- packages/cultmath/tools/compile-glsl.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/cultmath/tools/compile-glsl.ps1 b/packages/cultmath/tools/compile-glsl.ps1 index eba1c6cb..f43a7e8c 100644 --- a/packages/cultmath/tools/compile-glsl.ps1 +++ b/packages/cultmath/tools/compile-glsl.ps1 @@ -2,6 +2,9 @@ param( # A GLSL source to append after the generated wrapper's library instead of the call-every-function # body; tools\compile-glsl.ps1 -Body 'float x = lerp(0.0, 1.0, 0.5);' is the negative control. [string]$Body = "", + # Also concatenate shaders\CultMath.Phacelle.glsl (MPL-2.0) after CultMath.glsl, as a consumer that + # calls cultmath_phacelle does. Without it the wrapper is the MIT library alone. + [switch]$Phacelle, [string]$GlslangPath = "" ) @@ -17,6 +20,9 @@ if (-not $GlslangPath) { # by string concatenation (GLSL has no #include), then a fragment shader that calls every public # function once with zero arguments of its declared types. $library = Get-Content -LiteralPath (Join-Path $repoRoot "shaders\CultMath.glsl") -Raw +if ($Phacelle) { + $library += Get-Content -LiteralPath (Join-Path $repoRoot "shaders\CultMath.Phacelle.glsl") -Raw +} $calls = foreach ($match in [regex]::Matches($library, '(?m)^\w+\s+(cultmath_\w+)\s*\(([^)]*)\)')) { $arguments = foreach ($parameter in ($match.Groups[2].Value -split ',')) { $type = ($parameter.Trim() -split '\s+')[0]