From 932b0ef1ceecf873213447a8778e5cbe1b3b6be7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 14 Jul 2014 15:48:38 -0700 Subject: glsl: Use bit-flags image attributes and uint16_t for the image format All of the GL image enums fit in 16-bits. Also move the fields from the anonymous "image" structucture to the next higher structure. This will enable packing the bits with the other bitfield. 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): 76 40,572,916,873 68,831,248 63,328,783 5,502,465 0 After (32-bit): 70 40,577,421,777 68,487,584 62,973,695 5,513,889 0 Before (64-bit): 60 36,822,640,058 96,526,824 88,735,296 7,791,528 0 After (64-bit): 74 37,124,603,758 95,891,808 88,466,712 7,425,096 0 A real savings of 346KiB on 32-bit and 262KiB on 64-bit. Signed-off-by: Ian Romanick Reviewed-by: Kenneth Graunke --- src/glsl/ast_function.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/glsl/ast_function.cpp') diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index 39c7beeb22a..7130d616282 100644 --- a/src/glsl/ast_function.cpp +++ b/src/glsl/ast_function.cpp @@ -103,35 +103,35 @@ verify_image_parameter(YYLTYPE *loc, _mesa_glsl_parse_state *state, * qualifiers. [...] It is legal to have additional qualifiers * on a formal parameter, but not to have fewer." */ - if (actual->data.image.coherent && !formal->data.image.coherent) { + if (actual->data.image_coherent && !formal->data.image_coherent) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`coherent' qualifier", formal->name); return false; } - if (actual->data.image._volatile && !formal->data.image._volatile) { + if (actual->data.image_volatile && !formal->data.image_volatile) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`volatile' qualifier", formal->name); return false; } - if (actual->data.image.restrict_flag && !formal->data.image.restrict_flag) { + if (actual->data.image_restrict && !formal->data.image_restrict) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`restrict' qualifier", formal->name); return false; } - if (actual->data.image.read_only && !formal->data.image.read_only) { + if (actual->data.image_read_only && !formal->data.image_read_only) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`readonly' qualifier", formal->name); return false; } - if (actual->data.image.write_only && !formal->data.image.write_only) { + if (actual->data.image_write_only && !formal->data.image_write_only) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`writeonly' qualifier", formal->name); -- cgit v1.2.3