draw: fix nonzero stream primitives generated queries

the fastpath here can only be taken if there is exactly one stream active,
as this will otherwise break nonzero stream primitives generated queries

in truth, this num_vertex_streams thing should be a bitmask so that the case
of num_streams=1,stream_id!=0 could also be fastpathed, but the complexity
probably isn't worth it given the infrequency of use

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15506>
This commit is contained in:
Mike Blumenkrantz 2022-03-22 12:32:22 -04:00 committed by Marge Bot
parent 32f117f5f8
commit 36373e8e1e

View file

@ -277,7 +277,7 @@ void draw_pt_so_emit( struct pt_so_emit *emit,
struct vbuf_render *render = draw->render;
unsigned start, i, stream;
if (!emit->has_so) {
if (!emit->has_so && num_vertex_streams == 1) {
if (draw->collect_primgen) {
unsigned i;
unsigned total = 0;
@ -292,7 +292,7 @@ void draw_pt_so_emit( struct pt_so_emit *emit,
return;
}
if (!draw->so.num_targets)
if (!emit->has_so && !draw->collect_primgen)
return;
/* XXX: need to flush to get prim_vbuf.c to release its allocation??*/
@ -322,7 +322,7 @@ void draw_pt_so_emit( struct pt_so_emit *emit,
}
render->set_stream_output_info(render,
stream,
emit->emitted_primitives,
emit->has_so ? emit->emitted_primitives : 0,
emit->generated_primitives);
}
}