draw: use the prim type from prim_info not emit in passthrough emit
authorRoland Scheidegger <sroland@vmware.com>
Tue, 2 Dec 2014 01:27:56 +0000 (02:27 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 6 Dec 2014 17:03:11 +0000 (18:03 +0100)
The prim assembler may change the prim type when injecting prim ids now,
which isn't reflected by what's stored in emit.
This looks brittle and potentially dangerous (it is not obvious if such prim
type changes are really supported by pt emit, the prim type is actually also
set in prepare which would then be different).

This fixes piglit primitive-id-no-gs-first-vertex.shader_test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_pt_emit.c

index 011efe770101cd5daf36b45de3b1f8532bd4f54e..b215c5f4db440072fd301799f3a76814a7c90b6b 100644 (file)
@@ -143,7 +143,7 @@ draw_pt_emit(struct pt_emit *emit,
    /* XXX: and work out some way to coordinate the render primitive
     * between vbuf.c and here...
     */
-   draw->render->set_primitive(draw->render, emit->prim);
+   render->set_primitive(draw->render, prim_info->prim);
 
    render->allocate_vertices(render,
                              (ushort)translate->key.output_stride,
@@ -214,7 +214,7 @@ draw_pt_emit_linear(struct pt_emit *emit,
    /* XXX: and work out some way to coordinate the render primitive
     * between vbuf.c and here...
     */
-   draw->render->set_primitive(draw->render, emit->prim);
+   render->set_primitive(draw->render, prim_info->prim);
 
    if (!render->allocate_vertices(render,
                                   (ushort)translate->key.output_stride,