aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_functions.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-07-14 15:48:38 -0700
committerKenneth Graunke <[email protected]>2014-08-29 23:29:19 -0700
commit932b0ef1ceecf873213447a8778e5cbe1b3b6be7 (patch)
treee0925b8001889ad75902abe9c5d2d740b8883b5d /src/glsl/builtin_functions.cpp
parent8eeca7a56cf1ef47b6f86cc5a0397a532a7c2932 (diff)
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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/builtin_functions.cpp')
-rw-r--r--src/glsl/builtin_functions.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index c882ec8dd0d..9be7f6d1a76 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -4476,11 +4476,11 @@ builtin_builder::_image_prototype(const glsl_type *image_type,
* accept everything that needs to be accepted, and reject cases
* like loads from write-only or stores to read-only images.
*/
- image->data.image.read_only = flags & IMAGE_FUNCTION_READ_ONLY;
- image->data.image.write_only = flags & IMAGE_FUNCTION_WRITE_ONLY;
- image->data.image.coherent = true;
- image->data.image._volatile = true;
- image->data.image.restrict_flag = true;
+ image->data.image_read_only = (flags & IMAGE_FUNCTION_READ_ONLY) != 0;
+ image->data.image_write_only = (flags & IMAGE_FUNCTION_WRITE_ONLY) != 0;
+ image->data.image_coherent = true;
+ image->data.image_volatile = true;
+ image->data.image_restrict = true;
return sig;
}