Export (0) Print
Expand All

call (HLSL)

Bb313973.note(en-us,XNAGameStudio.31).gifNote
This HLSL attribute is available only when developing for the Xbox 360.

Prevents inlining of a function.

Syntax

[call]

Parameters

None

Scope

Applies to function definitions and function calls.

Remarks

By default, all user-defined HLSL functions are inlined by the HLSL compiler on Xbox 360. Use the call attribute to turn off inlining and decrease the amount of microcode emitted by the HLSL compiler.

You can use the call attribute to control inlining either when the function is defined or when a function is called.

  • If applied to a function definition, the function will not be inlined anywhere.
  • If applied to a function call, the function will not be inlined during the current call, but might be inlined elsewhere.

Examples

The following HLSL code snippet demonstrates how to apply the call attribute.

// This function will not be inlined.
[call]
float4 ComputePosition1 ()
{
  ...
}

// This function will be inlined wherever possible.
float4 ComputePosition2 ()
{
  ...
}

float4 main () : POSITION
{
  // ComputePosition1 will not be inlined.
  // ComputePosition2 will be inlined at this specific call site.
  float4 pos = ComputePosition1() + ComputePosition2();
  
  // ComputePosition2 will not be inlined at this specific call site.
  [call]
  return pos + ComputePosition2();
}      
    

Community Additions

ADD
Show:
© 2014 Microsoft