i965: Fix software primitive restart with indirect draws.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 11 Apr 2015 09:21:48 +0000 (02:21 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 14 Apr 2015 08:49:02 +0000 (01:49 -0700)
commit406df68736a213f17f21a38a7c2da4ea15acd053
treef2fc0337c99ed20c7ac65653a465f9b8f5c52a99
parentf55ded764ce60f87463e33bfa3a32e2c44715581
i965: Fix software primitive restart with indirect draws.

new_prim was declared as a stack variable within a nested scope; we
tried to retain a pointer to that data beyond the scope, which is bogus.

GCC with -O1 eliminated most of the code that set new_prim's fields.

Move the declaration to fix the bug.

v2: Also fix new_ib (thanks to Matt Turner and Ben Widawsky).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81025
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Cc: mesa-stable@lists.freedesktop.org
src/mesa/vbo/vbo_primitive_restart.c