How murray2k6/gldirect works
GLDirect is a Windows OpenGL DLL wrapper whose normal workflow accepts an application's WGL context and OpenGL calls, translates supported work into a D3D9 command stream, and submits it to the active D3D9 implementation. OpenGL stages D3D9 cannot represent run in a private Mesa worker; their results are synchronized into the D3D9 stream. The graph preserves the documented fixed-function, shader, resource, advanced-stage, and Remix paths. Most links rely on README statements; sampled source excerpts establish context management and Mesa pipeline behavior, but do not expose the complete runtime call graph.
Main entry points: gld5_driver.c D3D9 Driver · gl_impl.c GL API Dispatch · mesa_proxy.c Mesa Worker · gld_wgl.c WGL Context
Components 19
Windows Entry
- OpenGL DLL
src/dll_main.c - WGL Context
src/gld_wgl.c - Context State
src/gld_context.c - GL API Dispatch
src/gl46/gl_impl.c
GL Translation
- Fixed Function
src/gl46/fixed_function_emulator.c - Shader Translation
src/gl46/glsl_to_hlsl.c - State Translation
src/gl46/state_translator.c - Buffer Manager
src/gl46/buffer_manager.c - Texture Manager
src/gl46/texture_manager.c - Render Targets
src/gl46/render_target_manager.c
Execution Paths
- Advanced Emulation
src/gl46/advanced_emulation.c - Compute Emulation
src/gl46/compute_emulator.c - Mesa Worker
src/mesa_proxy.c - Mesa TNL Pipeline
mesa/src/mesa/tnl/t_pipeline.c
D3D9 Integration
- D3D9 Driver
src/dx9/gld5_driver.c - Swap Chain
src/gl46/swap_chain.c
Diagnostics
- Tracy Client
src/tracy_client.cpp
Other components
- GL Application
- D3D9 Runtime
Connections 25
- GL Application → OpenGL DLL: calls OpenGL
- OpenGL DLL → WGL Context: exports WGL
- WGL Context → Context State: creates and binds
- GL Application → GL API Dispatch: issues GL calls
- GL API Dispatch → Fixed Function: translates fixed state
- GL API Dispatch → Shader Translation: translates GLSL
- GL API Dispatch → State Translation: translates state
- GL API Dispatch → Buffer Manager: manages buffers
- GL API Dispatch → Texture Manager: manages textures
- GL API Dispatch → Render Targets: manages targets
- Fixed Function → D3D9 Driver: emits D3D9 draws
- Shader Translation → D3D9 Driver: emits shaders
- State Translation → D3D9 Driver: sets D3D9 state
- Buffer Manager → D3D9 Driver: submits geometry
- Texture Manager → D3D9 Driver: submits resources
- Render Targets → D3D9 Driver: binds render targets
- GL API Dispatch → Advanced Emulation: dispatches unsupported stages
- Advanced Emulation → Mesa Worker: executes post-vertex work
- Compute Emulation → Mesa Worker: executes compute
- Mesa Worker → Mesa TNL Pipeline: runs Mesa pipeline
- Mesa Worker → D3D9 Driver: submits results
- Compute Emulation → D3D9 Driver: syncs writable resources
- D3D9 Driver → D3D9 Runtime: sends D3D9 stream
- D3D9 Driver → Swap Chain: presents frames
- WGL Context → Tracy Client: starts profiling