firstbithigh function

Gets the location of the first set bit starting from the highest order bit and working downward, per component.

Syntax

int firstbithigh(
  in int value
);

Parameters

value [in]

Type: int

The input value.

Return value

Type: int

The location of the first set bit.

Remarks

For a signed integer, the first significant bit is zero for a negative number.

The following overloaded versions are also available:

int2 firstbithigh(int2 value);
int3 firstbithigh(int3 value);
int4 firstbithigh(int4 value);
uint firstbithigh(uint value);
uint2 firstbithigh(uint2 value);
uint3 firstbithigh(uint3 value);
uint4 firstbithigh(uint4 value);

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 5 and higher shader models yes

 

This function is supported in the following types of shaders:

Vertex Hull Domain Geometry Pixel Compute
x x x x x x

 

See also

Intrinsic Functions

Shader Model 5