Clamps x to the range [min, max].
| ret clamp(x, min, max) |
|---|
Where:
| Name | In/Out | Template Type | Component Type | Size |
|---|---|---|---|---|
| x | in | scalar, vector, or matrix | float, int | any |
| min | in | same as input x | float, int | same dimension(s) as input x |
| max | in | same as input x | float, int | same dimension(s) as input x |
| ret | out | same as input x | float, int | same dimension(s) as input x |
This intrinsic function is supported in the following (or above) shader versions:
| Vertex Shader | Pixel Shader |
|---|---|
| vs_1_1 | ps_1_4 |