state_tracker: Initialize the draw context only when needed.
authorEric Anholt <eric@anholt.net>
Tue, 2 Aug 2016 19:28:27 +0000 (12:28 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 4 Aug 2016 15:48:27 +0000 (08:48 -0700)
commit2a808219b3f9a50bc5bf3c5290db6a55cd707de7
tree031d59393725abe6c51ae74e458dfa859ce4548d
parentc976e164d262d2d2bfd8087dcbb7bd91995ae887
state_tracker: Initialize the draw context only when needed.

It's only used for rarely-used deprecated GL features
(feedback/rasterpos), so we can skip the memory allocation and
initialization for it most of the time.

Saves about 659k (out of 1605k) of maximum memory size according to massif
on simulated vc4 glsl-algebraic-add-add-1

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_cb_feedback.c
src/mesa/state_tracker/st_cb_rasterpos.c
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_draw.h
src/mesa/state_tracker/st_draw_feedback.c