diff options
author | Iago Toral Quiroga <itoral@igalia.com> | 2014-06-20 10:26:29 +0200 |
---|---|---|
committer | Iago Toral Quiroga <itoral@igalia.com> | 2014-06-30 08:08:50 +0200 |
commit | 8639effefeb8c06beedbfcc294694b6bb72db882 (patch) | |
tree | e27e6f1b77883bcfbf322fff2f4cdab22a7658bc /src/glsl/ir.h | |
parent | 9650293b51b23b86f4fcf6875e1801555fa235d0 (diff) |
glsl: Modify ir_emit_vertex to have a stream.
This will be necessary to implement EmitStreamVertex().
EmitVertex() will produce an ir_emit_vertex with the default stream 0.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
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 2e422ddac4a..fa22190d6fa 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -2159,9 +2159,11 @@ private: */ class ir_emit_vertex : public ir_instruction { public: - ir_emit_vertex() - : ir_instruction(ir_type_emit_vertex) + ir_emit_vertex(ir_rvalue *stream) + : ir_instruction(ir_type_emit_vertex), + stream(stream) { + assert(stream); } virtual void accept(ir_visitor *v) @@ -2169,12 +2171,19 @@ public: v->visit(this); } - virtual ir_emit_vertex *clone(void *mem_ctx, struct hash_table *) const + virtual ir_emit_vertex *clone(void *mem_ctx, struct hash_table *ht) const { - return new(mem_ctx) ir_emit_vertex(); + return new(mem_ctx) ir_emit_vertex(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; }; /** |