Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Annotation Syntax (Direct3D 10)

An annotation is a user-defined piece of information, declared with the following syntax.

<DataType Name = Value; ... ;>

 

Parameters

ItemDescription

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;
}


 

 

Community Additions

ADD
Show:
© 2015 Microsoft