Gallium3D: Graphics Done Right
Gallium3D: Graphics Done Right
Gallium3D: Graphics Done Right
GraphicsDone Right
Contents
Recap
Gallium3D
General summary Why would you want to use it. Gallium3D latest changes Taking request (no singing)
App
Mesa
DRI Driver
DRI
Drivers were tied to OS, API, window system. EG, dealing with DRI cliprects in DrawArrays. Driver interface becoming unmanageable.
Zack Rusin [email protected]
Graphics Pipeline
App
Mesa
DRI Driver
DRI
Isolate interactions with API, OS, HW. Identify new interfaces. Split the driver.
Zack Rusin [email protected]
Gallium in 2007
drm
App
Mesa
State tracker
Gallium HW Driver
Since then...
Rapid interface evolution Hopefully starting to stabilize, but there are still some minor issues outstanding. On the horizon: simplify TGSI shader representation Changes in the draw module New insights into fallbacks, driver structure. New utility code
Since then...
I915 (updated to head) softpipe Cell driver i965 Nouveau R300 work
Building blocks
Gallium3D at its core is just an interface The actual functionality is split across different modules
Building blocks
State trackers
Implement API on top of Gallium3D Integration with a windowing system, low level management (surfaces, buffers and fencing) Implements the Gallium3D interface
Winsys
Gallium3D driver
Building blocks
Draw
CSO
Buffers management code TGSI code LLVM integration A few others (sct, util)
Zack Rusin [email protected]
Software Rasterizer
App
Mesa
State tracker
softpipe
any winsys X
Codegen through LLVM and simple rtasm. A fairly clear path to performance. A good project for someone?
Zack Rusin [email protected]
Hardware: i915
i915 drm State tracker
App
Mesa
i915
Updated to the latest DRM changes. Near term goal: Rebase to X, DRM head. Later: DRI2, Polish, Performance...
Zack Rusin [email protected]
It works on Windows
DD DX9 State tracker
App
XP/DX9 Runtime
i915
XP winsys HW
App
i915
DirectFB, VxWorks, Kdrive, GLES, Cellphones, Robots, FreeBSD, MiniGLX, EGL, Clusters, etc. Wider audience --> better drivers.
Zack Rusin [email protected]
App
Mesa
State tracker
i965simple
Simulator Winsys
a file
A nice way to work on hardware you don't actually have available. Easy to capture, analyze dumps offline. TODO: Replay
Zack Rusin [email protected]
Shaders
LLVM
TGSI compiled into LLVM IR LLVM optimization passes used Drivers implement LLVM code-generator
Winsys issues
i915 drm State tracker
App
Mesa
i915
GLX implemented by DRI + the Winsys layer Swapbuffers, create surface, etc, seem to bypass this nice stack.
Zack Rusin [email protected]
Winsys issues
Neat diagram above ignores non-drawing aspects of the driver. There is real complexity here:
Surface allocation happens before context creation GL extensions need to know (approximately) before context creation. Swapbuffers
Currently winsys is splitting into two entities: per-screen and per-context. May end up with a parallel stack, ie:
Zack Rusin [email protected]
What's in a winsys?
State tracker HW context
GL App
GLX
HW info
Screen DRI
Orange components... A lot of interfaces... Small piece of code, but complex. SOON: Split it up for a clearer stack.
Zack Rusin [email protected]
New diagram
Summary
We're getting there. Interface churn should start to slow down, but some pain still to come. Focus to shift: