maxexports (HLSL)

Note

This HLSL attribute is available only when developing for the Xbox 360.

Specifies the maximum number of export instructions that will execute along any path from the entry point to an exit.

Syntax

[maxexports(n)]

Parameters

  • n
    Integer that represents the maximum number of export instructions.

Scope

Applies to functions. The maxexports attribute is ignored on any function except the shader entry point that is currently being compiled.

Examples

The following HLSL code snippet shows how to apply the maxexports attribute.

row_major float4x4 a;
float4 b;
row_major float4x4 c;
float4 d;

[maxexports(2)]
void main ( out float4 pos : POSITION,
  out float4 coord : TEXCOORD ) {
  
  pos = mul( a, b );
  coord = mul( c, d );
}
    

Without the call to the maxexports attribute, each mul HLSL intrinsic yields four microcode instructions.

With the call to the maxexports attribute, the HLSL compiler adds extra mov instructions to reduce the number of export instructions to two.

See Also

Concepts

HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories

Reference

HLSL Attributes Reference (Xbox 360)