Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
if (src_idx >= sm6->cur_max_value)
{
FIXME("Invalid value index %"PRIu64".\n", src_idx);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
"Invalid value index %"PRIu64" for a phi incoming value.", src_idx);
return;
}
/* May be a forward reference. */
src = &sm6->values[src_idx];
if (src->type && src->type != type)
{
WARN("Type mismatch.\n");
vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_TYPE_MISMATCH,
"The type of a phi incoming value does not match the result type.");
}
It's kind of annoying to just validate back references and not forward references. It already happens for `sm6_parser_get_value_idx_by_ref()`, since I don't think we ever go back checking that the type found in the operands array matches the type of its target. And I don't think we necessarily have to do something about it, since it's probably not a priority. But it irritates my need for uniformity.