vkd3d-shader/ir: Correctly compute the TEMP count after hull shader flattening.

The previous computation was incorrect because the count was taken
after resetting it to zero (as part of setting the instruction to NOP).
This commit is contained in:
Giovanni Mascellani 2023-11-16 23:07:27 +01:00 committed by Alexandre Julliard
parent 5cb17cfd1c
commit b1123ed35f
Notes: Alexandre Julliard 2023-11-20 22:33:01 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/481

View File

@ -207,10 +207,15 @@ static void flattener_eliminate_phase_related_dcls(struct hull_flattener *normal
{
/* Leave only the first temp declaration and set it to the max count later. */
if (!normaliser->max_temp_count)
{
normaliser->max_temp_count = ins->declaration.count;
normaliser->temp_dcl_idx = index;
}
else
vkd3d_shader_instruction_make_nop(ins);
{
normaliser->max_temp_count = max(normaliser->max_temp_count, ins->declaration.count);
vkd3d_shader_instruction_make_nop(ins);
}
return;
}