Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
dst->u.reg = param->reg;
}
+static bool instruction_dst_param_init_temp_vector(struct vkd3d_shader_instruction *ins, struct sm6_parser *sm6) +{
- struct sm6_value *dst = sm6_parser_get_current_value(sm6);
- struct vkd3d_shader_dst_param *param;
- if (!(param = instruction_dst_params_alloc(ins, 1, sm6)))
return false;
- vsir_dst_param_init(param, VKD3DSPR_TEMP, vkd3d_data_type_from_sm6_type(sm6_type_get_scalar_type(dst->type, 0)), 1);
- param->write_mask = VKD3DSP_WRITEMASK_ALL;
- param->reg.idx[0].offset = 0;
- param->reg.dimension = VSIR_DIMENSION_VEC4;
- dst->u.reg = param->reg;
Hmm, is this correct? If two instructions use this temporary register (which is always hardcoded at `r0`, isn't it?) and the former value is then recalled, it will be replaced with `r0`, but the register will have been, by then, overwritten with the result of the second instruction. Maybe the content of `r0` should immediately be copied to a SSA value?