diff options
author | Iago Toral Quiroga <[email protected]> | 2014-07-21 09:18:52 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2014-09-19 15:01:15 +0200 |
commit | c1b8a5155b4026ac6d0fdeae9afd12e489ef106b (patch) | |
tree | 309bb8000aa1c79c5e82b3d3072067a978a00634 | |
parent | d93ca68666675392e632a5c0f99a33ff25a42e53 (diff) |
i965/gen6/gs: Make sure we complete the last primitive.
Just in case the GS algorithm does not call EndPrimitive() for the last
primitive produced. This is relevant only for non point outputs, since for
this we are already setting the PrimEnd flag on each vertex we emit.
Acked-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp b/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp index 80085c658e6..77e1957be94 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp @@ -270,6 +270,19 @@ gen6_gs_visitor::emit_urb_write_opcode(bool complete, src_reg vertex, void gen6_gs_visitor::emit_thread_end() { + /* Make sure the current primitive is ended: we know it is not ended when + * first_vertex is not zero. This is only relevant for outputs other than + * points because in the point case we set PrimEnd on all vertices. + */ + if (c->gp->program.OutputType != GL_POINTS) { + emit(CMP(dst_null_d(), this->first_vertex, 0u, BRW_CONDITIONAL_Z)); + emit(IF(BRW_PREDICATE_NORMAL)); + { + visit((ir_end_primitive *) NULL); + } + emit(BRW_OPCODE_ENDIF); + } + /* Here we have to: * 1) Emit an FF_SYNC messsage to obtain an initial VUE handle. * 2) Loop over all buffered vertex data and write it to corresponding |