iris: Fix SO offset to be 32-bit in DrawTransformFeedback handling
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 29 Jul 2019 22:33:02 +0000 (15:33 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 29 Jul 2019 23:38:19 +0000 (16:38 -0700)
We accidentally started copying a full 64-bit value rather than copying
a 32-bit offset and zeroing the top 32-bits.  This caused us to compute
bogus vertex counts which could lead to GPU hangs in some cases.

Thanks to Clayton Craft for catching the regressions!

Fixes: 0e24d10ff5c ("iris: Use gen_mi_builder to handle CS ALU operations.")
src/gallium/drivers/iris/iris_state.c

index ed0714df2a8f5b15c802f6014b957bfdab6e8622..d32dc4995f8ed90fbc56cecf548399a2155d9e1b 100644 (file)
@@ -5319,7 +5319,7 @@ iris_upload_render_state(struct iris_context *ice,
       struct iris_address addr =
          ro_bo(iris_resource_bo(so->offset.res), so->offset.offset);
       struct gen_mi_value offset =
-         gen_mi_iadd_imm(&b, gen_mi_mem64(addr), -so->base.buffer_offset);
+         gen_mi_iadd_imm(&b, gen_mi_mem32(addr), -so->base.buffer_offset);
 
       gen_mi_store(&b, gen_mi_reg32(_3DPRIM_VERTEX_COUNT),
                        gen_mi_udiv32_imm(&b, offset, so->stride));