Module: vkd3d Branch: master Commit: b1123ed35f48017b18fdc27540bb681414fc472f URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/b1123ed35f48017b18fdc27540bb68...
Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Thu Nov 16 23:07:27 2023 +0100
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).
---
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 5c88946b..833f5084 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; }