Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
if (handler_idx == VKD3DSIH_NOP) { dst->u.reg = value->u.reg;
/* Set the result type for casts from 16-bit min precision. */
if (type->u.width != 16)
Shouldn't you set the type even when `type->u.width == 16`? For example, for a truncation from 64 to 16 bit, you should still set the destination type to a 32 bit integer, I think?
More in general, I am a bit confused by how you handle 16 bit types. Looking at `sm6_map_cast_op()` it seems that you're just transparently remapping 16 bit types to their corresponding 32 bit types (either floating point or integer). For example, it seems that for a `uint32 x` the expression `(uint32)(uint16)x == x` always holds, which is of course not the case if proper 16 bit integers are implemented (even if stored in half of a 32 bit register). The same happens for floating point 16 bit values. Wouldn't it be advisable to just reject any program using 16 bit types until we have proper support? Are there programs using them?