ftou (sm4 - asm)

Floating point to unsigned integer conversion.

ftou dest[.mask], [-]src0[_abs][.swizzle]


ftoi dest[.mask], [-]src0[_abs][.swizzle]




[in] The address of the result of the operation.


[in] The value to convert.



The conversion is performed per-component. Rounding is always performed towards zero, following the C convention for casts from float to int.

Applications that require different rounding semantics can invoke the round instructions before casting to integer.

Inputs are clamped to the range [0.0f ... 4294967295.999f] prior to conversion, and input NaN values produce a zero result.

Optional negate and absolute value modifiers are applied to the source values before conversion.

This instruction applies to the following shader stages:

Vertex ShaderGeometry ShaderPixel Shader


Minimum Shader Model

This function is supported in the following shader models.

Shader ModelSupported
Shader Model 5 yes
Shader Model 4.1 yes
Shader Model 4 yes
Shader Model 3 (DirectX HLSL) no
Shader Model 2 (DirectX HLSL) no
Shader Model 1 (DirectX HLSL) no


Related topics

Shader Model 4 Assembly (DirectX HLSL)