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

maxexports (HLSL)

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.




Integer that represents the maximum number of export instructions.


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


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

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

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.

Community Additions

© 2015 Microsoft