http://www.freedesktop.org/wiki/Software/gallium/
Gallium3D其实是一个接口层,解耦上层操作与驱动之间的联系:
主要接口
pipe_context 结构体(p_context.h), 其中定义了和context相关的函数集,这些函数主要包括如下功能:
- Setting rendering state (texture sampler state, blending state, rasterization state, vertex array info, drawing surfaces, etc.)
- Setting shader state, using the TGSI binary shader representation.
- Vertex array and indexed vertex array drawing.
pipe_screen结构体,包含与context无关的信息和函数集
- Creating textures (and drawing surfaces)
- Getting “views” into textures
- Hardware queries (number of texture units, max texture size, etc).
- Creating generic memory buffers
- Mapping/unmapping buffers
- Fencing
另外还有一些数据结构定义在p_state.h中
- Graphics state (blending, texture sampling, rasterization)
- Texture and surface resources
- Vertex array layout
State tracker
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. Basica