Skip to content

Simple Map of the Codebase

richgel999 edited this page Mar 16, 2014 · 6 revisions

This partial map currently only covers the most important replayer and tracer related libs/tools:

  • GL/GLX spec files under the "glspec" directory

We have a pretty complete database of GL/GLX/etc. function/parameter/namespace/type/pointer size/enum information, currently up to GL v4.0. It was bootstrapped from every known source we could get our hands on: Web scraped from opengl.org and the GL specs using a Python script, custom parsers for apitrace's glapi.py and the original GL/GLX spec/enum files, and we've dumped actual public driver symbol exports into the database.

  • voglcore library

Types, basic containers (vector, map/set, skip list, fixed/dynamic strings, etc.), file utils, posix regex, heap allocation, atomics/threading helpers, compression, textual/binary JSON, DXTc compression, KTX texture helpers, command line parsing, etc.

The mipmapped_texture and related classes are targeted for destruction/replacement very soon by devs at LunarG - they are only these for us to make quick progress in the UI. But the KTX texture classes are staying.

voglcore was originally crunch's core library, except we've focused and refined it for only the stuff vogl needs.

  • voglgen command line tool

Scans files under "glspec" and generates include files needed to build voglcommon and vogltrace. This tool is written more like a script, but in C++. Perf and memory don't matter one iota in here.

This tool parses, cross references, and most importantly transforms our GL/GLX database into something we can build against. Each source of API info is thoroughly cross referenced against every other source each time we run voglgen. We've invested a lot of time cleaning this data up.

voglgen is easily modified to generate data files containing whatever GL/GLX stuff you need: func macros, type enums, scripts, C/C++ code, etc.

  • voglinc include directory

Generated by the voglgen tool. 99% is macro invocations we use to generate the tracer, some parts of the replayer, and the GL helpers in the voglcommon code.

  • voglcommon

A static library with a large set of C helpers and generic C++ classes to save/restore/serialize/deserialize all GL context state and remap their handles and locations across domains: programs, shaders, buffers, textures, samplers, context metadata, context glGet's, queries, syncs, framebuffers, renderbuffers, vertex array objects, etc.

This library holds our runtime GL/GLX parameter type/entrypoint/etc. data structures that are used by the tracer and replayer. It also has a ton of GL/GLX helper functions such as things to convert GL/GLX enums to strings and back, basic GL binding state save/restore, GL internal/external texture format helpers, etc. The GL/GLX enum conversion functions support optional category (GL/GLX/WGL/etc.) or source GL type info to resolve enum collisions. Without this info the functions try to make a best guess using simple heuristics.

  • voglreplay

Swiss army knife-like tool, and staging/testing area. High-level code to do trace manipulation, output trace statistics, etc. lives here. The intention is to refactor large parts of this tool into reusable classes as features stabilize. We don't care how clean the code is up here or whether it's C or C++, it's just a staging area for eventual refactoring as we converge on working solutions, interesting features, etc.

  • vogltrace

LD_PRELOAD'able, or manually loadable, GL/GLX tracing SO. We export the same symbols as NVidia's driver. Relies on voglcore, voglcommon (along with backtrace, and libturbojpeg).

  • vogltest

Ancient test program used to help test the tracer while it was being bootstrapped, targeted for destruction or dumping into the gltests directory.

  • voglsyms

Command line tool used to resolve symbols by the tracer's backtrace code.