diff options
author | Iago Toral Quiroga <[email protected]> | 2014-06-20 10:38:53 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2014-06-30 08:08:50 +0200 |
commit | 4b3fc21032a63f483d381c36c8e41bf3540ebfcc (patch) | |
tree | 0f01cb04873f5eb0510713e37af1d200d3dcac09 /src/glsl/ir.h | |
parent | 8639effefeb8c06beedbfcc294694b6bb72db882 (diff) |
glsl: Modify ir_end_primitive to have a stream.
This will be necessary to implement EndStreamPrimitive().
EndPrimitive() will produce an ir_end_primitive with the default stream 0.
Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r-- | src/glsl/ir.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h index fa22190d6fa..d5239d4de1b 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -2192,9 +2192,11 @@ public: */ class ir_end_primitive : public ir_instruction { public: - ir_end_primitive() - : ir_instruction(ir_type_end_primitive) + ir_end_primitive(ir_rvalue *stream) + : ir_instruction(ir_type_end_primitive), + stream(stream) { + assert(stream); } virtual void accept(ir_visitor *v) @@ -2202,12 +2204,19 @@ public: v->visit(this); } - virtual ir_end_primitive *clone(void *mem_ctx, struct hash_table *) const + virtual ir_end_primitive *clone(void *mem_ctx, struct hash_table *ht) const { - return new(mem_ctx) ir_end_primitive(); + return new(mem_ctx) ir_end_primitive(this->stream->clone(mem_ctx, ht)); } virtual ir_visitor_status accept(ir_hierarchical_visitor *); + + int stream_id() const + { + return stream->as_constant()->value.i[0]; + } + + ir_rvalue *stream; }; /*@}*/ |