Export (0) Print
Expand All
abs
all
any
cos
ddx
ddy
dot
dst
exp
fma
lit
log
mad
max
min
mul
pow
rcp
sin
tan
Expand Minimize

max

Selects the greater of x and y.

ret max(x, y)

 

Parameters

ItemDescription

x

[in] The x input value.

y

[in] The y input value.

 

Return Value

The x or y parameter, whichever is the largest value.

Remarks

For values of -INF or INF, max will behave as expected. However for values of NaN, the results are undefined.

Type Description

NameIn/Out Template Type Component Type Size
xinscalar, vector, or matrix float, int any
yinsame as input x float, int same dimension(s) as input x
retreturn typesame as input x float, int same dimension(s) as input x

 

Minimum Shader Model

This function is supported in the following shader models.

Shader ModelSupported
Shader Model 2 (DirectX HLSL) and higher shader modelsyes
Shader Model 1 (DirectX HLSL) yes (vs_1_1 and ps_1_4)

 

See also

Intrinsic Functions (DirectX HLSL)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft