I noticed that snorm and unorm are, apparently, HLSL keywords (after trying to use them as variable names).
MSDN is very brief about these "type modifiers":
Quote
Differences between Direct3D 9 and Direct3D 10:
In Direct3D 10, the following types are modifiers to the float type.
snorm float - IEEE 32-bit signed-normalized float in range -1 to 1 inclusive.
unorm float - IEEE 32-bit unsigned-normalized float in range 0 to 1 inclusive.
For example, here is a 4-component signed-normalized float-variable declaration.snorm float4 fourComponentIEEEFloat;
So I wonder:
- Does casting between snorm float and unorm float and float work as intended?
- What happens when casting from a float that is out-of-range to a snorm and unorm?
- Is it also possible to add these type modifiers to half and double.
- Should one prefer these type modifiers over a manual conversion (is a "mad" instruction guaranteed?)