by Katen Shah, Luis Gimenez , Arzhange Safdarzadeh
The goal of this paper is to describe the behavior of constants in DirectX* 9 and DirectX 10 to help developers optimize the performance of the applications in Intel® Processor Graphics.
Intel Processor Graphics refers to Intel® Graphics Media Accelerator used in the Intel® 4 Series Chipsets (the Intel® 4500, X4500, and X4500HD GMAs). These chipsets are used in desktop G41, G43, and G45 and mobile GM45 and GM47 systems.
In general, the core of the graphics media accelerators is broken into generations: these generations are known as Gen3, Gen4, Gen5, etc. Commonly, these are known as “GenX.” Each year, more capabilities and better performance are provided by new processor graphics cores. Intel Processor Graphics has the largest market share for new PC shipments. Source Mercury Research (Q1/09). Therefore, it makes sense to write your 3D applications to this market segment and optimize the experience for the largest number of people.
Constants are external variables passed as parameters to the shaders; their values remain “constant” during each invocation of the shader program. Despite their name, constants are one of the most frequently changing values in a DirectX application. A shader program can initialize a constant variable statically to a value in the shader file or at runtime through the application.
Most of the recommendations described here are not completely new and may have been described elsewhere. However, it is still very much applicable to processor graphics and the recommendations are provided in a cohesive manner. Finally, care needs to be taken when porting from DirectX 9 to DirectX 10 to maintain performance.
Constants In DirectX 9 AND DirectX 10
In DirectX 9 the constant data is specified in constant registers, while in DirectX 10 external variables residing in constant buffers are passed as parameter to the shader program.
Depending on the use and declaration in the shader program constants can be immediate, immediate indexed, or dynamic indexed.
Read the rest of the article by downloading the PDF below.