From e3fe2cec07acf9ffb319a6a9ddbbb32084f009c6 Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Wed, 6 Aug 2025 12:10:00 -0400 Subject: [PATCH] vkd3d-shader/ir: Use iterators in vsir_allocate_temp_registers(). --- libs/vkd3d-shader/ir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 59196f90e..11e1e6ba6 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -8828,8 +8828,10 @@ static void temp_allocator_set_dst(struct temp_allocator *allocator, enum vkd3d_result vsir_allocate_temp_registers(struct vsir_program *program, struct vkd3d_shader_message_context *message_context) { + struct vsir_program_iterator it = vsir_program_iterator(&program->instructions); const unsigned int prev_temp_count = program->temp_count; struct temp_allocator allocator = {0}; + struct vkd3d_shader_instruction *ins; struct temp_allocator_reg *regs; struct liveness_tracker tracker; enum vkd3d_result ret; @@ -8863,10 +8865,8 @@ enum vkd3d_result vsir_allocate_temp_registers(struct vsir_program *program, ++allocator.allocated_ssa_count; } - for (unsigned int i = 0; i < program->instructions.count; ++i) + for (ins = vsir_program_iterator_head(&it); ins; ins = vsir_program_iterator_next(&it)) { - const struct vkd3d_shader_instruction *ins = &program->instructions.elements[i]; - /* Make sure we do the srcs first; setting the dst writemask may need * to remap their swizzles. */ for (unsigned int j = 0; j < ins->src_count; ++j)