diff options
author | Ian Romanick <[email protected]> | 2014-05-14 18:36:57 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-09-30 13:34:42 -0700 |
commit | 8afe6efa218f87158c35857fad41926b404a2cbd (patch) | |
tree | 610c0f091cbeb8185ad9faf2e78f6bfed020501a /src/glsl/ir.h | |
parent | ab51179f1fe8f365cc5357f498e4ce690c28bd3a (diff) |
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 <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]> [v1]
Reviewed-by: Tapani Pälli <[email protected]> [v1]
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r-- | src/glsl/ir.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 67150ce6cd8..d96f44029c9 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -709,6 +709,13 @@ public: */ unsigned index:1; + /** + * \brief Layout qualifier for gl_FragDepth. + * + * This is not equal to \c ir_depth_layout_none if and only if this + * variable is \c gl_FragDepth and a layout qualifier is specified. + */ + ir_depth_layout depth_layout:3; /** * ARB_shader_image_load_store qualifiers. @@ -719,9 +726,6 @@ public: unsigned image_volatile:1; unsigned image_restrict:1; - /** Image internal format if specified explicitly, otherwise GL_NONE. */ - uint16_t image_format; - /** * Emit a warning if this variable is accessed. */ @@ -729,13 +733,8 @@ public: uint8_t warn_extension_index; public: - /** - * \brief Layout qualifier for gl_FragDepth. - * - * This is not equal to \c ir_depth_layout_none if and only if this - * variable is \c gl_FragDepth and a layout qualifier is specified. - */ - ir_depth_layout depth_layout; + /** Image internal format if specified explicitly, otherwise GL_NONE. */ + uint16_t image_format; /** * Storage location of the base of this variable |