I don't think it really makes sense to track the location in the vkd3d_shader_normaliser structure. After a couple of transformations, the instruction index may no longer have much of a relation to the original source location. I think we should instead store location information in the vkd3d_shader_instruction structure, much like how the HLSL compiler stores location information in e.g. the hlsl_ir_node structure. Eventually, that should also make it straightforward to emit SpvOpLine instructions in the SPIR-V backend, giving us useful debug information in the generated SPIR-V.
I'm not quite sure about VKD3D_SHADER_ERROR_IR_REGISTER_ORDER_TOO_HIGH. On the one hand, it makes sense that we'd have our own errors on the IR level. On the other hand, this feels like something the TPF frontend should have caught and emitted an error for while parsing. Perhaps others have opinions?