mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
draw: add support for collecting primitives generated outside streamout
GL/gallium require gathering primitives generated outside streamout stats. This introduces the draw interfaces to enabling collecting this. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
f137672197
commit
5f8af9731e
4 changed files with 28 additions and 1 deletions
|
|
@ -1155,6 +1155,15 @@ draw_collect_pipeline_statistics(struct draw_context *draw,
|
|||
draw->collect_statistics = enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable primitives generated gathering.
|
||||
*/
|
||||
void draw_collect_primitives_generated(struct draw_context *draw,
|
||||
bool enable)
|
||||
{
|
||||
draw->collect_primgen = enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes clipper invocation statistics.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -312,6 +312,9 @@ void draw_set_force_passthrough( struct draw_context *draw,
|
|||
void draw_collect_pipeline_statistics(struct draw_context *draw,
|
||||
boolean enable);
|
||||
|
||||
void draw_collect_primitives_generated(struct draw_context *draw,
|
||||
bool eanble);
|
||||
|
||||
/*******************************************************************************
|
||||
* Draw pipeline
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -348,6 +348,8 @@ struct draw_context
|
|||
struct pipe_query_data_pipeline_statistics statistics;
|
||||
boolean collect_statistics;
|
||||
|
||||
bool collect_primgen;
|
||||
|
||||
struct draw_assembler *ia;
|
||||
|
||||
void *driver_private;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "pipe/p_state.h"
|
||||
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_prim.h"
|
||||
#include "util/u_memory.h"
|
||||
|
||||
struct pt_so_emit {
|
||||
|
|
@ -273,8 +274,20 @@ 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) {
|
||||
if (draw->collect_primgen) {
|
||||
unsigned i;
|
||||
unsigned total = 0;
|
||||
for (i = 0; i < input_prims->primitive_count; i++) {
|
||||
total +=
|
||||
u_decomposed_prims_for_vertices(input_prims->prim,
|
||||
input_prims->primitive_lengths[i]);
|
||||
}
|
||||
render->set_stream_output_info(render,
|
||||
0, 0, total);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!draw->so.num_targets)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue