How tixolan/varyn works
Varyn is a Vulkan live-shader playground. A user supplies a TOML scene; the app loads configuration and assets, evaluates time-dependent expressions, compiles modular shaders, and renders the scene to a window. The renderer also supports model instances, extra shader passes, textures, and per-instance environment reflections. File watching reloads changed inputs, with shader-only recompilation distinct from full config and asset reloads. Edges reflect documented behavior and visible module references; some internal call details are unsampled, so those links are omitted.
Main entry points: Config.cpp TOML config · Renderer.cpp Scene renderer · App.hpp App loop · Swapchain.hpp Swapchain
Components 17
Application
- Command line
src/main.cpp - App loop
src/App.hpp - File watching
src/FileWatcher.hpp
Scene Inputs
- TOML config
src/Config.cpp - Expressions
src/Expression.cpp - Shader modules
examples/modules - Model loading
src/Mesh.cpp
Rendering
- GPU scene assets
src/render/Scene.cpp - Shader compilation
src/ShaderCompiler.cpp - Shader interface
src/UniformLayout.hpp - Frame evaluation
src/render/Evaluate.hpp - Scene renderer
src/render/Renderer.cpp
Vulkan Runtime
- Vulkan context
src/vulkan/VulkanContext.hpp - GPU resources
src/vulkan/Resources.hpp - Swapchain
src/vulkan/Swapchain.hpp
Other components
- Shader author
- Window and GPU
Connections 27
- Shader author → Command line: runs
README.md - Shader author → TOML config: configures
README.md - Shader author → Shader modules: authors
README.md - Command line → App loop: starts
src/main.cpp - Command line → TOML config: loads for header
src/main.cpp - App loop → TOML config: reloads
src/App.hpp - App loop → File watching: watches inputs
src/App.hpp - App loop → Scene renderer: owns renderer
src/App.hpp - TOML config → Expressions: stores expressions
- TOML config → Model loading: describes models
README.md - TOML config → GPU scene assets: describes assets
- Shader modules → Shader compilation: included and compiled
README.md - TOML config → Shader compilation: selects shaders
- TOML config → Shader interface: defines uniforms
src/UniformLayout.hpp - Expressions → Frame evaluation: evaluated per frame
src/render/Evaluate.hpp - Scene renderer → Frame evaluation: evaluates values
src/render/Renderer.cpp - Scene renderer → Shader compilation: compiles shaders
- Scene renderer → GPU scene assets: draws scene
- Scene renderer → Shader interface: writes uniforms
- Scene renderer → GPU resources: uses GPU resources
- Scene renderer → Swapchain: renders and presents
- App loop → Vulkan context: owns context
src/App.hpp - App loop → Swapchain: owns swapchain
src/App.hpp - Vulkan context → Window and GPU: creates surface and device
src/vulkan/VulkanContext.hpp - Swapchain → Vulkan context: uses context
src/vulkan/Swapchain.hpp - GPU resources → Vulkan context: allocates through
src/vulkan/Resources.hpp - Swapchain → Window and GPU: presents frames
src/vulkan/Swapchain.hpp