Download Users Manual
Transcript
Appendix B Language Profiles To specify bindings between texture units and uniform parameters/texture coordinates to match their application, all sampler uniform parameters and texture coordinate inputs that are used in the program must have matching binding semantics—that is, TEXUNIT<n> may only be used with TEXCOORD<n>. Partially specified binding semantics may not work in all cases. Fundamentally, this restriction is due to the close coupling between texture samplers and texture coordinates in DirectX pixel shaders 1_X. Binding Semantics for Uniform Data If a binding semantic for a uniform parameter is not specified then the compiler will allocate one automatically. Scalar uniform parameters may be allocated to either the xyz or the w portion of a constant register depending on how they are used within the Cg program. When using the output of the compiler without the Cg runtime, you must set all values of a scalar uniform to the desired scalar value, not just the x component. The valid binding semantics for uniform parameters in the ps_1_X profiles are summarized in Table 51. Table 51. ps_1_x Uniform Input Binding Semantics Binding Semantics Name Corresponding Data register(s0)—register(s3) TEXUNIT0—TEXTUNIT3 Texture unit N, where N is in range [0..3]. May be used only with uniform inputs with sampler* types. register(c0)–register(c7) C0–C7 Constant register [0..7] Binding Semantics for Varying Input/Output Data The varying input binding semantics in the ps_1_X profiles are the same as the varying output binding semantics of the vs_1_1 profile. Varying input binding semantics in the ps_1_X profiles consist of COLOR0, COLOR1, TEXCOORD0, TEXCOORD1, TEXCOORD2 and TEXCOORD3. These map to output registers in DirectX vertex shaders. 808-00504-0000-006 NVIDIA 313