Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/ir.c:
} }
- normaliser->phase = VKD3DSIH_INVALID;
- input_control_point_count = 1;
- has_control_point_phase = false;
- for (i = 0; i < instructions->count; ++i)
- {
ins = &instructions->elements[i];
if (shader_instruction_is_fork_or_join_phase(ins) && !has_control_point_phase
&& !normaliser_is_in_fork_or_join_phase(normaliser))
`normaliser_is_in_fork_or_join_phase(normaliser)` is always `false`, because as soon as you see a fork or join phase you return, isn't it?
More in general, it seems that the logic of this loop is more complicated than it could be, unless I am missing something. It seems that you want to invoke `shader_normaliser_emit_hs_input()` the first time you see a fork or join phase, provided that you didn't see a control point phase. To do that it is enough to return as soon as you see a control point phase and call that function as soon as you see a fork or join phase (and then return). You don't need to track the phase or whether you've already seen a control point phase.