Next | Prev | Up | Top | Contents | Index
Optimizing the Imaging Pipeline
Here are some points that help you optimize the imaging pipeline:
- Unsigned color types are faster than signed or float types.
- Smaller component types (for example, GL_UNSIGNED_BYTE) require less bandwidth from the host to the graphics pipeline and are faster than larger types.
- The slow pixel drawing path is used when fragment operations (depth or alpha testing, and so on) are used, or when the format is GL_DEPTH_COMPONENT, or when multisampling is enabled and the visual has a multisample buffer.
Using the Color Matrix and the Color Writemask
Your application might perform RGBA imaging operations (for example convolution, histogram, and such) on a single-component basis. This is the case either when processing gray scale (monochrome) images, or when different color components are processed differently.
RealityEngine systems currently do not support RGBA-capable monochrome visuals (a feature that is introduced by the framebuffer configuration extension; see "The Framebuffer Configuration Extension"). You must therefore use a four-component RGBA visual even when performing monochrome processing. Even when monochrome RGBA-capable visuals are supported, you may find it beneficial to use four-component visuals in some cases, depending on your application, to avoid the overhead of the glXMakeCurrent() or glXMakeCurrentReadSGI() call.
On RealityEngine systems, monochrome imaging pipeline operations are about four times as fast as the four-component processing. This is because only a quarter of the data has to be processed or transported either from the host to graphics subsystem--for example, for glDrawPixels()--or from the framebuffer to the graphics engines--for example, for glCopyPixels().
The RealityEngine implementation detects monochrome processing by examining the color matrix (see "Tuning the Imaging Pipeline") and the color writemask.
The following operations are optimized under the set of circumstances listed below:
- glDrawPixels() with convolution enabled and
- the pixel format is GL_LUMINANCE or GL_LUMINANCE_ALPHA
- the color matrix is such that the active source component is red
- glCopyPixels() and the absolute value of GL_ZOOM_X and GL_ZOOM_Y is 1.
Here's the set of circumstances to be met:
- All pixel maps and fragment operations are disabled.
- The color matrix does not scale any of the components.
- The post color matrix scales and biases for all components are 1 and 0, respectively.
- Either write is enabled only for a single component (R, G, B, or A), or alpha-component write is disabled.
Next | Prev | Up | Top | Contents | Index