A parameter list is a comma-separated list of parameters that make up the function declaration. Function parameter lists are defined very much like C functions.
Each parameter can be declared with one or more of the following components:
[Parameter Modifiers] ParameterType ParameterName [: Semantic] [= Initializers]
Optionally identifies a parameter as an input, an output, or both.
uniform | A uniform shader variable whose value comes from a constant register. This is a variable that is initialized in the constant registers with the ID3DXConstantTable interface. All the vertices (if you are using a vertex shader) or pixels (if you are using a pixel shader) see the same initial value in a uniform variable. Global variables are treated as if they are declared uniform. |
---|---|
in | Marks a parameter as input only. |
out | Marks a parameter as output only. |
inout | Marks a parameter as both an input and an output. |
Parameters are always passed by value. in indicates that the value of the parameter should be copied in from the calling application before the function begins. out indicates that the last value of the parameter should be copied out, and returned to the calling application when the function returns. inout is a shorthand for specifying both.
uniform is a special of kind of in, indicating to a top-level function that the value for the parameter comes from constant data. For non-top-level functions, uniform is synonymous with in. If no parameter usage is specified, the parameter usage is assumed to be in.
Any valid type including:
An ASCII string that uniquely identifies the name of the shader function.
Semantics attach shader input and output parameters with pipeline data, or other shader parameters. See Shader Semantic Syntax.
An initializer is an optional, default value.