The previous computation was incorrect because the count was taken after resetting it to zero (as part of setting the instruction to NOP).
From: Giovanni Mascellani gmascellani@codeweavers.com
The previous computation was incorrect because the count was taken after resetting it to zero (as part of setting the instruction to NOP). --- libs/vkd3d-shader/ir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 2a3343994..6926de927 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -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 + { + normaliser->max_temp_count = max(normaliser->max_temp_count, ins->declaration.count); vkd3d_shader_instruction_make_nop(ins); - normaliser->max_temp_count = max(normaliser->max_temp_count, ins->declaration.count); + } return; }
This merge request was approved by Giovanni Mascellani.
This merge request was approved by Henri Verbeet.