Annotation Syntax (Direct3D 11)

An annotation is a user-defined piece of information, declared with the syntax described in this section.

<DataType Name = Value; ... ;>

Parameters

Item Description
DataType
[in] The data type, which includes any scalar HLSL type as well as the string type.
Name
[in] An ASCII string, that represents the annotation name.
Value
[in] The initial value of the annotation.
...
[in] Additional annotations (name-value pairs).

Remarks

You may add more than one annotation within the angle brackets, each one separated by a semicolon. The effect framework APIs recognize annotations on global variables; all other annotations are ignored.

Example

Here are some examples.

       
int i <int blabla=27; string blacksheep="Hello There";>;

int j <int bambam=30; string blacksheep="Goodbye There";> = 5 ;

float y <float y=2.3;> = 2.3, z <float y=1.3;> = 1.3 ;

half w <half GlobalW = 3.62;>;

float4 main(float4 pos : SV_POSITION ) : SV_POSITION
{
    pos.y = pos.x > 0 ? pos.w * 1.3 : pos.z * .032;
    for (int x = i; x < j ; x++) 
    {
        pos.w = pos.w * pos.y + x + j - y * w;
    } 

return pos;
}

Effect Format

Effect Variable Syntax