countbits function

Counts the number of bits (per component) in the input integer.

Syntax

uint countbits(
  in uint value
);

Parameters

value [in]

Type: uint

The input value.

Return value

Type: uint

The number of bits.

Remarks

The following overloaded versions are also available:


uint count_bits(uint value);
uint2 count_bits(uint2 value);
uint3 count_bits(uint3 value);
uint4 count_bits(uint4 value);

Minimum Shader Model

This function is supported in the following shader models.

Shader ModelSupported
Shader Model 5 and higher shader modelsyes

 

This function is supported in the following types of shaders:

VertexHullDomainGeometryPixelCompute
xxxxxx

 

See also

Intrinsic Functions
Shader Model 5

 

 

Show: