summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl/ir.h')
-rw-r--r--src/compiler/glsl/ir.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index f07e3b20910..433ba193801 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -599,7 +599,8 @@ public:
inline bool is_name_ralloced() const
{
- return this->name != ir_variable::tmp_name;
+ return this->name != ir_variable::tmp_name &&
+ this->name != this->name_storage;
}
/**
@@ -624,6 +625,16 @@ public:
*/
const char *name;
+private:
+ /**
+ * If the name length fits into name_storage, it's used, otherwise
+ * the name is ralloc'd. shader-db mining showed that 70% of variables
+ * fit here. This is a win over ralloc where only ralloc_header has
+ * 20 bytes on 64-bit (28 bytes with DEBUG), and we can also skip malloc.
+ */
+ char name_storage[16];
+
+public:
struct ir_variable_data {
/**