LONDON, UK - 14th June, 2002 - NVIDIA® produce capable graphics hardware that, since the introduction of the GeForce 3, contains a degree of programmability. It is programmable in the powerful but low-level pixel and vertex shader level, these being hardware-specific features of their products.
NVIDIA® are now advocating a simplified cut-down language, known as Cg, which allows programming of those low level pixel and vertex shaders. They are promoting this as an open standard, being suitable to program all 'GPUs' or graphics processor units.
However, not all GPUs are created equal, and differences will become ever greater. With the PlayStation®2, SCEI demonstrated a programmable graphics pipeline from higher up in the rendering process, which has different demands of a graphics programming language.
In the future, graphics hardware will incorporate both low level pixel and vertex shaders as demonstrated by NVIDIA® and higher-level general programmability as demonstrated in the PlayStation®2. The Cg language is not sufficiently well specified for such hardware, particularly with reference to:
No break, continue, goto, switch, case, default. These are useful features that can be used without penalty on other vector processors.
No pointers. This is Cg's most serious omission. Pointers are necessary for storing scene graphs, so this will quickly become a serious omission for vector processors that can store and process the entire scene or even sections of it.
No integers. This may be appropriate to NVIDIA®, but is not a universal design decision.
Arrays use float indices. This is an odd design decision, relevant to DirectX 8 and NVIDIA® only.
NVIDIA® have introduced Cg as a standard, fully backward- and forward-compatible. However, the existence of reserved keywords (such as break and continue, mentioned above) is a clear indication that functions will be added when NVIDIA® hardware supports it. This is not conducive to future compatibility.
Codeplay believes that Cg is inadequate for some current, and more future, ‘GPU’s. Most importantly, standard rendering code needs to move onto graphics processors, and Cg is not sufficiently flexible for this type of code.
Codeplay Director Andrew Richards says, “Overall, Cg is not a generic language for graphics programming; it is a language for NVIDIA®’s current generation of graphics card. It has a different set of goals from what’s required to design computer graphics at the heart of the successful computer games of tomorrow.â€