feat: Metal port + SwiftUI runtime for Paper Shaders - #1
Merged
Conversation
Extracts the 29 web shaders, transpiles GLSL to Metal via glslang/spirv-cross, remaps fragment varyings to the vertex shader's canonical locations, and emits dist/*.metal plus a typed manifest with param bounds, enum options and UI groups. Includes doctor, CLI, and the 29/29 golden-gate test suite.
Drives the preview app session file (set_shader/set_params) and renders SKILL.md from the manifest so param docs never drift from the source.
Manifest decoding, reflection-driven pipeline builder and std140 params encoder, MTKView ShaderView, offscreen renderer, session store with adoption policy, bundled textures and gallery images.
Manifest-driven param panel, category sidebar with presets, paper-dark fluid UI (tabs, sliders, tooltips, export slide-over), image gallery, live params.json session round-trip, bundled app icon and fonts.
Renders every shader offscreen and compares against blessed snapshots; plus unit suites for encoder, pipeline, manifest, session and codecs.
Golden gate builds dist and runs the toolchain tests; swift-runtime builds dist, checks SKILL.md freshness, builds and tests the Swift package. Concurrency group cancels stale runs.
#available guards at runtime only; the CI toolchain's SDK doesn't have the symbol, so the file fails to compile. resizeLeftRight works everywhere.
…arams buffer, shorten float literals
…t, and preview app
…for SPM consumers
…s absent The repo-wide bun test job runs on Linux, which cannot have glslang, spirv-cross or xcrun. Those tests now skip there and still run for real in the macOS shaders-metal workflow.
l0kyurue1
force-pushed
the
feat/metal-port
branch
from
July 13, 2026 10:00
7ea488a to
c98f6a2
Compare
Unfiltered push + pull_request ran the macOS jobs twice for every PR-branch push.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports Paper Shaders to Metal and adds a Swift/SwiftUI runtime, so the shader library can be used from native Apple apps instead of only the web.
Two new packages:
packages/shaders-metal— a build toolchain that compiles the existing GLSL fragment shaders to Metal (GLSL → SPIR-V → MSL → AIR validation), a generatedmanifest.jsondescribing all 29 shaders and their params, an MCP server (list_shaders,set_shader,set_params,read_params,export_snippet), an agent skill generated from the manifest, and anexportcommand that emits a self-contained.metal+ Swift snippet per shader.packages/shaders-metal-swift— the SwiftUI runtime:ShaderView(shaderID:params:)loads a shader by ID with no boilerplate,MetalRenderViewhandles the iOS/macOS split, precompiled.metallibshaders are bundled for SPM consumers, and a preview app lets you browse and tweak every shader live.Verification
Notes