[Mesa-dev] [PATCH 11/21] glsl: Store ir_variable::ir_type in 8 bits instead of 32

Ian Romanick idr at freedesktop.org
Tue May 27 19:49:06 PDT 2014


From: Ian Romanick <ian.d.romanick at intel.com>

No change in the peak ir_variable memory usage in a trimmed apitrace of
dota2 on 64-bit.

No change in the peak ir_variable memory usage in a trimmed apitrace of
dota2 on 32-bit.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/ir.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 7faee74..bc02f6e 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -92,12 +92,13 @@ enum ir_node_type {
  */
 class ir_instruction : public exec_node {
 private:
-   enum ir_node_type ir_type;
+   uint8_t ir_type;
 
 public:
    inline enum ir_node_type get_ir_type() const
    {
-      return this->ir_type;
+      STATIC_ASSERT(ir_type_max < 256);
+      return (enum ir_node_type) this->ir_type;
    }
 
    /**
-- 
1.8.1.4



More information about the mesa-dev mailing list