Share via


maxInstructionCount (HLSL)

Note

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

Sets the maximum number of instructions available to a shader.

Syntax

[maxInstructionCount(n)]

Parameters

  • n
    Integer that represents the maximum number of instructions. The n parameter must be a value between 256 and 3839.

Scope

Applies to an entire shader.

Remarks

The Xbox 360 GPU contains an instruction store of 4096 microcode instructions that Direct3D allocates between vertex and pixel shaders. By default, Direct3D allocates 2047 instructions on the GPU to vertex shaders and 2048 instructions on the GPU to pixel shaders. (One instruction at index 0 is reserved.) By default, the HLSL compiler accommodates these requirements by emitting shaders that do not exceed 2048 instructions.

Use the maxInstructionCount attribute to increase or decrease the limit to the number of instructions that can be emitted by the HLSL compiler. Note that this attribute does not change the number of instructions allocated to shaders on the GPU.

The number of instructions that can be emitted by the HLSL compiler should not be greater than the number of instructions available on the GPU. This situation produces an error.

See Also

Concepts

HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories

Reference

HLSL Attributes Reference (Xbox 360)