Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/ir.c:
tmp_idx = parser_get_extra_temp(parser);
/* tmp = ins->src[0] < 0 */
ins = texkill_ins + 1;
vsir_instruction_init(ins, &texkill_ins->location, VKD3DSIH_LTO);
ins->dst_count = 1;
if (!(ins->dst = dst_param = shader_parser_get_dst_params(parser, ins->dst_count)))
return VKD3D_ERROR_OUT_OF_MEMORY;
memset(dst_param, 0, sizeof(*dst_param) * ins->dst_count);
vsir_register_init(&dst_param->reg, VKD3DSPR_TEMP, VKD3D_DATA_INT, 1);
dst_param->reg.dimension = VSIR_DIMENSION_VEC4;
dst_param->reg.idx[0].offset = tmp_idx;
dst_param->write_mask = VKD3DSP_WRITEMASK_ALL;
I think these blocks can be made more readable with a few helpers, see again https://gitlab.winehq.org/giomasce/vkd3d/-/commit/b771e30fd5c5f52478c9f92f8c....
Notice that using those helpers is currently a bit more annoying than it could be because `dst` and `src` are pointers to `const` in `vkd3d_shader_instruction`. I plan to overcome this by submitting a MR to remove that `const`.