summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/mtypes.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-08-02 12:48:47 -0700
committerEric Anholt <eric@anholt.net>2016-08-04 08:52:11 -0700
commit49741e1cd23c726f1956fe2b2e78a85ba8482385 (patch)
tree5eea90229c056c46195556d28acae24b136e47d8 /src/mesa/main/mtypes.h
parent2a808219b3f9a50bc5bf3c5290db6a55cd707de7 (diff)
downloadexternal_mesa3d-49741e1cd23c726f1956fe2b2e78a85ba8482385.zip
external_mesa3d-49741e1cd23c726f1956fe2b2e78a85ba8482385.tar.gz
external_mesa3d-49741e1cd23c726f1956fe2b2e78a85ba8482385.tar.bz2
mesa: Dynamically allocate the matrix stack.
By allocating and initializing the matrices at context creation, the OS couldn't even overcommit the pages. This saves about 63k (out of 946k) of maximum memory size according to massif on simulated vc4 glsl-algebraic-add-add-1. It also means we could potentially relax the maximum stack sizes, but that should be a separate commit. v2: Drop redundant Top update, explain why the stack is small at init time. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/main/mtypes.h')
-rw-r--r--src/mesa/main/mtypes.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 2647f8f..5b02fad 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3990,6 +3990,7 @@ struct gl_matrix_stack
{
GLmatrix *Top; /**< points into Stack */
GLmatrix *Stack; /**< array [MaxDepth] of GLmatrix */
+ unsigned StackSize; /**< Number of elements in Stack */
GLuint Depth; /**< 0 <= Depth < MaxDepth */
GLuint MaxDepth; /**< size of Stack[] array */
GLuint DirtyFlag; /**< _NEW_MODELVIEW or _NEW_PROJECTION, for example */