translate_sse: Use the correct buffer index in this fast path.
[mesa.git] / src / gallium / auxiliary / translate / translate_sse.c
index 1b698cd7c7c30917a2759242e37a90ea9860f052..c7c53b3fb6c614bcf57c12a8a8bc5588c24993a1 100644 (file)
@@ -1228,8 +1228,10 @@ static boolean
 incr_inputs(struct translate_sse *p, unsigned index_size)
 {
    if (!index_size && p->nr_buffer_variants == 1) {
+      const unsigned buffer_index = p->buffer_variant[0].buffer_index;
       struct x86_reg stride =
-         x86_make_disp(p->machine_EDI, get_offset(p, &p->buffer[0].stride));
+         x86_make_disp(p->machine_EDI,
+                       get_offset(p, &p->buffer[buffer_index].stride));
 
       if (p->buffer_variant[0].instance_divisor == 0) {
          x64_rexw(p->func);