Graphics Reference
In-Depth Information
frexp
Returns the mantissa and exponent of a floating-point value
isfinite
Returns true if a floating point value is not infinite
isinf
Returns true if a floating point value is equal to -INF or +INF
Returns true if a floating point value is equal to NAN or QNAN
isnan
Multiplies a value to another value equal to 2 raised to a specified exponent
ldexp
lerp
Linearly interpolates between two values, using a specified scale value
Computes ambient, diffuse, and specular values for a Blinn-Phong BRDF
lit
Multiplies two values and sums the product with a third value
mad
max
Returns the maximum of two values
min
Returns the minimum of two values
modf
Splits a floating-point value into integral and fractional parts
radians
Converts a value from degrees to radians
rep
Calculates a fast, approximate reciprocal of a value
reversebits
Reverses the order of the bits in an integer value
rsqrt
Calculates the reciprocal of the square root of a value
saturate
Clamps a value to the [0, 1] range
Uses a Hermite interpolation to calculate a value between 0 and 1, using
a specified value, minimum, and maximum
smoothstep
step
Returns 1 if one specified value is greater than another, and 0 otherwise
Table 6.6. General math intrinsics.
6.7.2 Casting/Conversion Functions
In some cases, a resource will contain values in a particular data format that cannot be
directly read in HLSL. Consequently, HLSL provides casting and conversion intrinsics so
that shader programs can cast or convert a resource value to an appropriate data type. These
intrinsics are listed in Table 6.7.
Description
Intrinsic
Reinterprets a value as a float
asfloat
Reinterprets two 32-bit values as a double
asdouble
asint
Reinterprets a value as an int
asuint
Reinterprets a value as a uint
fl6to32
Converts a 16-bit floating-point value to a 32-bit floating-point value
f32tol6
Converts a 32-bit floating-point value to a 16-bit floating-point value
Table 6.7. Casting/Conversion intrinsics.
Search WWH ::




Custom Search