vkd3d-shader/hlsl: Improve capacity of folding constant values at parse-time.
This is basically the first 6 commits of the current version of !787 (merged).
The previous approach to folding default values into constants was to hold an hlsl_src
to the instruction in struct hlsl_default_value
and, after applying most of the passes in hlsl_emit_bytecode()
check if those were successfully lowered to a single hlsl_ir_constant
instruction.
@zfigura suggested we try to lower these values to constants at parse time instead, and I think this was a good call.
It requires calling more passes at parse time though, but I think that is good because these are also required in other places like array sizes.