Driver
From AttilaWiki
Contents |
Attila Driver
The Attila driver architecture has been designed with a goal in mind: to support a great variety of 3D applications in the Attila Architecture.
To this end, the ACDL layer (Attila Common Driver Layer) supposes a friendly hardware abstraction layer that allows to build many specific API´s on top, used by this applications: the widely used OpenGL implementations (OpenGL 2.0 and OpenGL ES), the DirectX Graphics API´s (DX9 and DX10) or new high realistic micropolygon based API´s making use of the current 3D rasterization hardware (the NVIDIA Gelato software using a REYES-like algorithm is a first example).
The Attila Driver support is currently being extended following the ACDL approach. Up to now two different modules have been implemented for two popular high-level APIs: the AOGL (Attila OpenGL Driver) and the ADX9 (Attila Direct3D 9 Driver). Future work comprises the implementation of the ADX10 (Attila Direct3D 10 Driver), the AGLES (Attila OpenGL ES Driver) or the AREY (Attila REYES Driver), based on the RenderMan´s specification.
Attila Common Driver Layer (ACDL)
The ACDL module provides an abstraction layer for the Attila Architecture, giving a friendly high-level interface of a generic 3D graphics API, suitable for building concrete graphics APIs on top. The ACDL is more than a simply HAL as usually known. It provides a lot of special features specially suited to make the Graphics API implementation easier. Among them, we highlight the following ACDL features:
- Complete Attila architecture state management: this state, setteable in a per-stage basis, is aware of the current hardware register values and an optimal state management is performed, avoiding useless register updates. In addition, the entire set or some specific states can be saved and restored in any time, thus allowing the easy implementation of the OpenGL Attrib Groups or the Direct3D State Blocks.
- Complete resource management: all the data-container objects, from a simply buffer holding vertex positions to a shader program with the related constants or a complete set of cubemap faces textures, each one with different mipmap levels, are transparently managed by the ACDL, both in terms of GPU memory allocation and related register synchronization. The user/API does not have to worry about memory allocation, although some preferred allocation hints specified by the user/API are supported by the ACDL resource allocator.
- Shader program optimization: The ACDL interface, as newer APIs do, is based on the user-defined shader approach, without fixed function support (although fixed function emulation is provided by the ACDLX module ). That means that the user/API have to specify the code for the vertex and fragment programmable stages using the attila ISA. This attila shader program bytecode is further optimized by the ACDL when used for the rendering.
- Data layout optimization: Other crucial data structures are optimized before sending to the Attila hardware. For instance, vertex data layout is properly padded and special texture tiling orders are applied, all of this not visible to the user/API.
- ACDL Checkpoints: As long as the ACDL has setteable states and resource objects, some debug purpose functions are provided as part of the ACDL interface to save human readable snapshots of the entire ACDL state in disk files, and further restore of this state, supporting checkpointing mechanisms in this way.
- ACDL Warning Checks: After conscientiously setting up all the different states in the ACDL pipeline, many different situations make the whole thing to end up in a final annoying black screen. The reasons can be manyfold: a simply disabled color mask state, a meaningless configured stencil, depth or alpha function that discards all the processed fragments, a vertex shader computing only the front face color meanwhile the front face culling is enabled, and so on. To detect these cases, the ACDL allows enabling triggers to catch and print out these risk situations in disk files.
Attila Common Driver Layer eXtensions (ACDLX)
The ATTILA CDLX is an utility library that provides some extended functionality to the ACDL layer. These services are provided in a separate module because they are no longer used by current applications using the newest graphics APIs, and only the older APIs implementations could optionally use them.
The most important services offered by the ACDLX are the following:
- Fixed Pipeline Emulation generating equivalent shader programs for ACDL.
- Data layout formatting methods to support different color formats.
Attila Open GL Module (AOGL)
The Attila OpenGL Module implements a large subset of OpenGL calls using the Attila hardware acceleration and, in its current status, it supports some of the most important API features from OpenGL specs 1.4 to 2.0.
This allows full real execution of advanced OpenGL applications as Doom3 or Quake4 games, using the following API features and extensions:
- About 200 API calls supported
- ARB vertex program and ARB fragment program extensions.
- Vertex Arrays and Vertex Buffer Objects for geometry attributes.
- Multitexturing with up to 16 active texture stages.
- Texture Objects with multiple mipmap levels, allowing a maximum texture image size of 2048x2048 with 1D, 2D and CUBE MAP texture targets.
- Support for S3 Texture Compression (S3TC) modes DXT1, DXT3 and DXT5.
- Nearest, Bilinear, Trilinear and up to 16X Anisotropic texture filtering with wrapping modes.
- Full fragment operation support: Stencil test, Depth test, Alpha Test and Blending Functions.
- Fixed Function supported features based on the OpenGL 2.0 spec:
- 85% for the vertex shading stage:
- Per-vertex standard OpenGL transform & lighting: Point, directional and spot lights. Attenuation. Local and infinite viewer. Vertex & normal transform
- Automatic texture coordinate generation: Object Plane and Eye Plane, Normal Map, Reflection Map and Sphere Map.
- 90% for the fragment shading stage:
- All the standard multitexturing and texture combine functions: and additionaly GL_NV_texture_env_combine4 and ATI_texture_env_combine3 extensions.
- FOG application: Linear, Exponential and Second Order Exponential
- 85% for the vertex shading stage:
- Push and Pop attrib groups supported (xls)
Attila DX9 Module (ADX9)
Attila DX9 Module is in a heavy construction stage. It's close to support commercial 3D games, as Half Life 2.
See:
- D3D driver evolution, to see the progress done in D3DDriver.
- D3D driver gallery, some videos and screenshots.
Highlights:
- Vertex and pixel shaders up to version 3_0.
- Render targets.
- Vertex buffers/index buffers/user pointer streaming modes.
- 2D/Cube/Volume textures, most common formats supported, including compressed ones.
- Z/Alpha/Stencil tests.
- Alpha blending.



