diff options
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r-- | src/glsl/ir.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 6c7c60a27d9..57d701acc5f 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -35,6 +35,7 @@ #include "ir_visitor.h" #include "ir_hierarchical_visitor.h" #include "main/mtypes.h" +#include "memory_writer.h" #ifdef __cplusplus @@ -108,6 +109,10 @@ public: void print(void) const; void fprint(FILE *f) const; + /* serialization */ + void serialize(memory_writer &mem); + virtual void serialize_data(memory_writer &mem) = 0; + virtual void accept(ir_visitor *) = 0; virtual ir_visitor_status accept(ir_hierarchical_visitor *) = 0; virtual ir_instruction *clone(void *mem_ctx, @@ -168,6 +173,8 @@ public: virtual ir_rvalue *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual void accept(ir_visitor *v) { v->visit(this); @@ -382,6 +389,8 @@ public: virtual ir_variable *clone(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_variable *as_variable() { return this; @@ -791,6 +800,8 @@ public: ir_function_signature *clone_prototype(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + virtual void accept(ir_visitor *v) { v->visit(this); @@ -917,6 +928,8 @@ public: virtual ir_function *clone(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_function *as_function() { return this; @@ -991,6 +1004,8 @@ public: virtual ir_if *clone(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_if *as_if() { return this; @@ -1020,6 +1035,8 @@ public: virtual ir_loop *clone(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + virtual void accept(ir_visitor *v) { v->visit(this); @@ -1053,6 +1070,8 @@ public: virtual ir_assignment *clone(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); virtual void accept(ir_visitor *v) @@ -1439,6 +1458,8 @@ public: virtual ir_expression *clone(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + /** * Attempt to constant-fold the expression * @@ -1524,6 +1545,8 @@ public: virtual ir_call *clone(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); virtual ir_call *as_call() @@ -1607,6 +1630,8 @@ public: virtual ir_return *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_return *as_return() { return this; @@ -1651,6 +1676,8 @@ public: virtual ir_loop_jump *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual void accept(ir_visitor *v) { v->visit(this); @@ -1691,6 +1718,8 @@ public: virtual ir_discard *clone(void *mem_ctx, struct hash_table *ht) const; + virtual void serialize_data(memory_writer &mem); + virtual void accept(ir_visitor *v) { v->visit(this); @@ -1761,6 +1790,8 @@ public: virtual ir_texture *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); virtual void accept(ir_visitor *v) @@ -1862,6 +1893,8 @@ public: virtual ir_swizzle *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); virtual ir_swizzle *as_swizzle() @@ -1931,6 +1964,8 @@ public: virtual ir_dereference_variable *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); virtual ir_dereference_variable *as_dereference_variable() @@ -1982,6 +2017,8 @@ public: virtual ir_dereference_array *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); virtual ir_dereference_array *as_dereference_array() @@ -2023,6 +2060,8 @@ public: virtual ir_dereference_record *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); virtual ir_dereference_record *as_dereference_record() @@ -2093,6 +2132,8 @@ public: virtual ir_constant *clone(void *mem_ctx, struct hash_table *) const; + virtual void serialize_data(memory_writer &mem); + virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); virtual ir_constant *as_constant() @@ -2221,6 +2262,8 @@ public: return new(mem_ctx) ir_emit_vertex(); } + virtual void serialize_data(memory_writer &mem); + virtual ir_visitor_status accept(ir_hierarchical_visitor *); }; @@ -2245,6 +2288,8 @@ public: return new(mem_ctx) ir_end_primitive(); } + virtual void serialize_data(memory_writer &mem); + virtual ir_visitor_status accept(ir_hierarchical_visitor *); }; |