[Mesa-dev] [PATCH 4/4] draw: use the prim type from prim_info not emit in passthrough emit

sroland at vmware.com sroland at vmware.com
Mon Dec 1 17:31:10 PST 2014


From: Roland Scheidegger <sroland at vmware.com>

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).
I guess ideally shouldn't mess with topologies when injecting prim ids and
just inject them at the right vertices (depending on prim type and provoking
vertex convention).

This fixes piglit primitive-id-no-gs-first-vertex.shader_test.
---
 src/gallium/auxiliary/draw/draw_pt_emit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c
index 011efe7..b215c5f 100644
--- a/src/gallium/auxiliary/draw/draw_pt_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_emit.c
@@ -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,
-- 
1.9.1



More information about the mesa-dev mailing list