summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.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/ir.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/ir.cpp')
-rw-r--r--src/glsl/ir.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index d09ff9e5ffa..b289c29756d 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -1568,11 +1568,11 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
this->data.interpolation = INTERP_QUALIFIER_NONE;
this->data.max_array_access = 0;
this->data.atomic.offset = 0;
- this->data.image.read_only = false;
- this->data.image.write_only = false;
- this->data.image.coherent = false;
- this->data.image._volatile = false;
- this->data.image.restrict_flag = false;
+ this->data.image_read_only = false;
+ this->data.image_write_only = false;
+ this->data.image_coherent = false;
+ this->data.image_volatile = false;
+ this->data.image_restrict = false;
if (type != NULL) {
if (type->base_type == GLSL_TYPE_SAMPLER)
@@ -1678,11 +1678,11 @@ ir_function_signature::qualifiers_match(exec_list *params)
a->data.interpolation != b->data.interpolation ||
a->data.centroid != b->data.centroid ||
a->data.sample != b->data.sample ||
- a->data.image.read_only != b->data.image.read_only ||
- a->data.image.write_only != b->data.image.write_only ||
- a->data.image.coherent != b->data.image.coherent ||
- a->data.image._volatile != b->data.image._volatile ||
- a->data.image.restrict_flag != b->data.image.restrict_flag) {
+ a->data.image_read_only != b->data.image_read_only ||
+ a->data.image_write_only != b->data.image_write_only ||
+ a->data.image_coherent != b->data.image_coherent ||
+ a->data.image_volatile != b->data.image_volatile ||
+ a->data.image_restrict != b->data.image_restrict) {
/* parameter a's qualifiers don't match */
return a->name;