Download Users Manual

Transcript
Cg Language Toolkit
DirectX Pixel Shader 2.x Profiles (ps_2_*)
The DirectX Pixel Shader 2.0 Profiles are used to compile Cg source code to DirectX 9 PS 2.0 pixel shaders7 and DirectX 9 PS 2.0 extended pixel shaders. ‰
Profile names ps_2_0 (for DirectX 9 PS 2.0 pixel shaders) ps_2_x (for DirectX 9 PS 2.0 extended pixel shaders) ‰
How to invoke: Use the compiler options -profile ps_2_0 ‐profile ps_2_x
The ps_2_0 profile limits Cg to match the capabilities of DirectX PS 2.0 pixel shaders. The ps_2_x profile is the same as the ps_2_0 profile but allows extended features such as arbitrary swizzles, larger limit on number of instructions, no limit on texture instructions, no limit on texture dependent reads, and support for predication. This section describes the capabilities and restrictions of Cg when using these profiles.
Memory
Program Instruction Limit
DirectX 9 Pixel shaders have a limit on the number of instructions in a pixel shader. ‰
PS 2.0 (ps_2_0) pixel shaders are limited to 32 texture instructions and 64 arithmetic instructions. ‰
Extended PS 2 (ps_2_x) shaders have a limit of maximum number of total instructions between 96 to 1024 instructions. There is no separate texture instruction limit on extended pixel shaders. If the compiler needs to produce more than the maximum allowed number of instructions to compile a program, it reports an error. Vector Register Limit
Likewise, there are limited numbers of registers to hold program parameters and temporary results. Specifically, there are 32 read‐only vector registers 7. To understand the capabilities of DirectX PS 2.0 Pixel Shaders and the code produced by the compiler, refer to the Pixel Shader Reference in the DirectX 9 SDK documentation.
300
NVIDIA
808-00504-0000-006