mesa: Disallow relinking if a program is used by an active XFB object.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 6 Sep 2013 22:41:19 +0000 (15:41 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 12 Sep 2013 17:19:10 +0000 (10:19 -0700)
commit2b71b3d4666b076ef45d03b9b4b4c527bda21e1c
treef56915e1c03885c3aea2157fa177dcb57afb2338
parent9cc74c93f8983f978e7315e021eb59dfaca6404b
mesa: Disallow relinking if a program is used by an active XFB object.

Paused transform feedback objects may refer to a program other than the
current program.  If any active objects refer to a program, LinkProgram
must reject the request to relink.

The code to detect this is ugly since _mesa_HashWalk is awkward to use,
but unfortunately we can't use hash_table_foreach since there's no way
to get at the underlying struct hash_table (and even then, we'd need to
handle locking somehow).

Fixes the last subcase of Piglit's new ARB_transform_feedback2
api-errors test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/shaderapi.c
src/mesa/main/transformfeedback.c
src/mesa/main/transformfeedback.h