HLSL supports the following scalar types:
BOOL | true or false (Boolean) |
int | 32-bit signed integer |
half | 16-bit floating point value |
float | 32-bit floating point value |
double | 64-bit floating point value |
Not all target platforms have native support for integer values. Integer values may need to be emulated using floating point hardware. Integer operations that go outside the range (of integers that can be expressed as floats) are not guaranteed to function as expected.
Not all target platforms have native support for half or double values. If the target platform does not, these are emulated using float. Intermediate results of floating point expressions may be evaluated at a precision higher than the operands or the result.
HLSL also supports the ASCII string type. There are no operations or states that accept strings. String parameters and annotations can, however, be queried by effects.