glsl: Store ir_variable::depth_layout using 3 bits
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 15 May 2014 01:36:57 +0000 (18:36 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 30 Sep 2014 20:34:42 +0000 (13:34 -0700)
commit8afe6efa218f87158c35857fad41926b404a2cbd
tree610c0f091cbeb8185ad9faf2e78f6bfed020501a
parentab51179f1fe8f365cc5357f498e4ce690c28bd3a
glsl: Store ir_variable::depth_layout using 3 bits

warn_extension_index was moved to improve packing.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 73 40,580,476,304       68,488,400       62,796,151     5,692,249            0
After  (32-bit): 73 40,575,751,558       68,116,528       62,618,607     5,497,921            0

Before (64-bit): 71 37,124,890,613       95,889,584       88,089,008     7,800,576            0
After  (64-bit): 62 37,123,578,526       95,150,784       87,711,304     7,439,480            0

A real savings of 173KiB on 32-bit and 368KiB on 64-bit.

v2: Use the enum name with the bit-field and remove the extra casts.
Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> [v1]
src/glsl/ir.h