How feederbrian/appgl-runtime works
AppGL is a macOS OpenGL 4.6-to-Metal translation layer. The principal workflow starts with an application’s OpenGL calls, routes them through installed dispatch into per-context state and object handling, translates shaders and draw state, then submits work to Metal. The README also identifies runtime-selected feature flags and the fp64, fragment-shading-rate, and sparse-texture extensions. The sampled source is partial, so links for unsampled subsystem internals are omitted where their wiring is uncertain.
Main entry points: GLContext.h GL context · AppGLRuntime.cpp Runtime · ExtensionRegistry.h Extension registry · ShaderTranslator.cpp Shader translation
Components 23
GL interface
- OpenGL API
include/AppGL/AppGL.h - GL dispatch
src/loader/DispatchInstall.cpp
Runtime and state
- Runtime
src/runtime/AppGLRuntime.cpp - GL context
src/context/GLContext.h - GL state tracker
src/state/GLStateTracker.h - GL object store
src/objects/GLObjectStore.cpp - Capabilities
src/caps/GLCapabilities.h - Feature flags
src/runtime/AppGLFeatureFlags.h
Translation and rendering
- Shader translation
src/shader/ShaderTranslator.cpp - Compatibility rewrite
src/shader/CompatShaderRewrite.cpp - GLSL reflection
src/shader/GLSLReflection.cpp - Pipeline cache
src/shader/PipelineCache.cpp - Metal frame graph
src/context/MetalFrameGraph.h - Metal submission
src/context/MetalCommandSubmission.h
Extensions
- Extension registry
src/extensions/ExtensionRegistry.h - fp64 emulation
src/extensions/fp64/Fp64Module.h - Shading rate
src/extensions/fragment_shading_rate/FragmentShadingRateModule.h - Sparse texture
src/extensions/sparse_texture/SparseTextureModule.h
Diagnostics
- Diagnostics
src/runtime/AppGLDiagnostics.cpp - Coverage tracking
src/debug/CoverageStore.cpp - Trace log
src/debug/TraceLog.cpp
Other components
- OpenGL application
- Metal runtime
Connections 22
- OpenGL application → OpenGL API: calls GL
- OpenGL API → GL dispatch: dispatches
- GL dispatch → Runtime: enters runtime
- Runtime → GL context: manages context
- GL context → GL state tracker: updates state
- GL context → GL object store: accesses objects
- GL context → Capabilities: checks support
- Runtime → Feature flags: reads flags
- GL context → Shader translation: translates shaders
- Shader translation → Compatibility rewrite: rewrites shaders
- Shader translation → GLSL reflection: reflects GLSL
- GL context → Pipeline cache: uses cache
- GL context → Metal frame graph: encodes draws
- Metal frame graph → Metal submission: submits commands
- Metal submission → Metal runtime: executes commands
- GL context → Extension registry: uses extensions
- Extension registry → fp64 emulation: dispatches extension
- Extension registry → Shading rate: dispatches extension
- Extension registry → Sparse texture: dispatches extension
- Runtime → Diagnostics: exposes diagnostics
- Diagnostics → Coverage tracking: reports coverage
- Diagnostics → Trace log: reports trace