http://tungstengraphics.com/wiki/index.php/Gallium3D

Gallium3D Technical Overview


Gallium3D is Tungsten Graphics' new architecture for building 3D graphics drivers. Initially supporting Mesa and Linux graphics drivers, Gallium3D is designed to allow portability to all major operating systems and graphics interfaces.

Compared to existing Linux graphics drivers, Gallium3D will:

Make drivers smaller and simpler.
Current DRI drivers are rather complicated. They're large, contain duplicated code and are burdened with implementing many concepts tightly tied to the OpenGL 1.x/2.x API.
Model modern graphics hardware.
The new driver architecture is an abstraction of modern graphics hardware, rather than an OpenGL->hardware translator. The new driver interface will assume the presence of programmable vertex/fragment shaders and flexible memory objects.
Support multiple graphics APIs.
The OpenGL 3.0 API will be very different from OpenGL 1.x/2.x. We'd like a driver model that is API-neutral so that it's not tied to a specific graphics API.

This document describes the software components of the Gallium3D architecture. The intended audience is graphics software developers.


Contents

[hide]

[edit] The Gallium3D Interface

The public interface of a Gallium3D driver is described by the p_context.h and p_screen.h header files.

The pipe_context structure is an abstract base class with per-context methods for:

  • Setting rendering state (texture sampler state, vertex array info, drawing surfaces, etc.)
  • Setting shader state, using the TGSI binary shader representation.
  • Vertex array and indexed vertex array drawing.

The pipe_screen structure is an abstract base class with context-independent methods for:

  • Creating textures (and drawing surfaces)
  • Getting "views" into textures
  • Hardware queries (number of texture units, max texture size, etc).

The pipe_winsys structure provides methods for:

  • Creating generic memory buffers
  • Mapping/unmapping buffers
  • Fencing

By abstracting OS and window system services, pipe drivers are portable to other platforms (e.g. embedded devices).

Additional Gallium interface information.


[edit] The State Tracker

The state tracker is the piece which interfaces core Mesa to the Gallium3D interface. It's responsible for translating Mesa state (blend modes, texture state, etc) and drawing commands (like glDrawArrays and glDrawPixels) into pipe objects and operations.

Traditional fixed-function OpenGL components (such as lighting and texture combining) are implemented with shaders. OpenGL commands such as glDrawPixels are translated into textured quadrilateral rendering. Basically, any rendering operation that isn't directly supported by modern graphics hardware is translated into a hardware-friendly form.

Future state trackers will be created for OpenGL 3.0 and OpenGL-ES 2.x.


[edit] Softpipe Driver

The softpipe driver is a software implementation of the Gallium3D interface. It will be used as a reference implementation and as a fallback driver when a hardware driver isn't available. The softpipe driver will make extensive use of run-time code generation to efficiently execute vertex, fragment and rasterization operations.


[edit] Simple i915 Driver

The i915 Gallium3D Driver is an initial hardware driver implementation within the Gallium3D driver architecture. We expect that once complete this driver will have equivalent functionality and performance to the current Mesa i915tex driver, but from a much smaller codebase.


[edit] Cell Driver

Tungsten Graphics is developing a Gallium driver for the IBM Cell processor (as found in the PS3) in conjunction with Lawrence Berkeley National Lab. Initially, the objective is to implement only basic OpenGL triangle rendering with texture mapping. The second phase of the project will produce a full-featured driver.


[edit] Failover Module

The failover module acts as a selector between a hardware driver and the softpipe driver. When the hardware can't implement a particular rendering operation, the failover module will pass the request to the softpipe driver. This is a different solution to the "software fallbacks" scheme of previous Mesa drivers.


[edit] Ancillary Modules

A number of ancillary modules are available to Gallium3D drivers:

1. The Draw module provides point/line/polygon rendering services such as vertex transformation, polygon culling and clipping. It will be used by drivers for hardware which lacks vertex transformation (such as the i915/i945). It may also be instantiated and used directly by the state tracker to implement some API functionality that doesn't map well to hardware capabilities.

2. The TGSI module provides a universal representation of shaders and CPU-based execution of shaders. All Mesa vertex/fragment programs and shaders are translated into the TGSI representation before being passed to the driver. In turn, the driver will convert the TGSI instructions into GPU-specific instructions. For hardware that lacks vertex or fragment shader support, the TGSI's executor can be used. The TGSI executor includes support for SSE code generation. Support for other processors (such as Cell) will be added in the future.


[edit] Status

As of January, 2008:

The softpipe driver is nearly feature complete and runs most OpenGL programs. There is limited support for SSE and LLVM code generation, but that's still under development.

The i915 driver runs most OpenGL programs, though there's still loose ends.

The i965 driver is under construction.

The Cell driver is actively being developed. Some basic Mesa tests such as 'gears' are running.


Current development task list: Gallium TODO


[edit] References

Gallum3D talk from XDS 2007

Cross-referenced source code

TGSI specification


Reply via email to