Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/ir.c:
source = materialize_ssas_to_temps_compute_source(&program->instructions.elements[j],
current_label);
if (!materialize_ssas_to_temps_synthesize_mov(program, &instructions[ins_count],
&ins->location, &program->instructions.elements[j].dst[0], cond, source, true))
goto fail;
++ins_count;
}
struct phi_incoming_to_temp *incoming = &info->incomings[j];
mov_ins = &instructions[ins_count++];
vsir_instruction_init(mov_ins, &ins->location, VKD3DSIH_MOV);
mov_ins->src = incoming->src;
mov_ins->src_count = 1;
mov_ins->dst = incoming->dst;
mov_ins->dst_count = 1;
Hmm, I'm not sure I like this: unless I'm missing something, it means that might end up with many instructions pointing to the same `struct vkd3d_shader_register` object, which might be confusing for some later pass if, say, they write to a register and some other seemingly unrelated register is altered too. I'd suggest to rather allocate a new register and copy the data. It probably uses some more memory, but we might be saving ourselves a lot of debugging headache in the future.