min - HLSL

Selects the lesser of x and y.

Syntax

ret min(x, y)

Where:

Name In/Out Template Type Component Type Size
x in scalar, vector, or matrix float, int any
y in same as input x float, int same dimension(s) as input x
ret return type same as input x float, int same dimension(s) as input x

Minimum Shader Version

This intrinsic function is supported in the following (or above) shader versions:

Vertex Shader Pixel Shader
vs_1_1 ps_1_4

See Also

HLSL Intrinsic Functions