OSDN Git Service

i965: Add texrect scale parameters before pointers to ParameterValues.
authorEric Anholt <eric@anholt.net>
Wed, 21 Nov 2012 21:23:36 +0000 (13:23 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 28 Dec 2012 18:53:33 +0000 (10:53 -0800)
commitffdfafb06cf3ae468ceb3e504365016347f54bee
tree8f42084df572d7eddaabae112d338c3dc2637e04
parent6ccc505fc0bbd7aab3d14930d2d220bcdf2777de
i965: Add texrect scale parameters before pointers to ParameterValues.

If adding scale parameters during program compile caused a realloc of
ParameterValues, then the driver uniform storage set up by
_mesa_associate_uniform_storage() would point to potentially freed
memory.

Note that this uses TexturesUsed, which may change at runtime for GLSL
when sampler uniforms change.  This is a flaw in our handling of texrect
in general, and not one I'm fixing currently.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/brw_program.h
src/mesa/drivers/dri/i965/brw_shader.cpp