summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-12-02 15:01:06 +1000
committerDave Airlie <[email protected]>2019-12-06 06:48:30 +1000
commit201ed4b4e7e02b32f511b52ae94019792284f0a1 (patch)
tree9408a58f6fd41d9e90f6fb415ea2bf47b8d10e94 /src/gallium
parent5f8af9731e36cb8854f7096cd372b83022a004b4 (diff)
llvmpipe: enable support for primitives generated outside streamout
This enables the draw support when the queries are enabled. Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.h2
-rw-r--r--src/gallium/drivers/llvmpipe/lp_draw_arrays.c4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_query.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
index 6ce0454538f..1d36f4968cc 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
@@ -103,6 +103,8 @@ struct llvmpipe_context {
unsigned active_occlusion_queries;
+ unsigned active_primgen_queries;
+
bool queries_disabled;
unsigned dirty; /**< Mask of LP_NEW_x flags */
diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
index 01f3cf3cdfc..cf81111b407 100644
--- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
+++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
@@ -122,6 +122,10 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
draw_collect_pipeline_statistics(draw,
lp->active_statistics_queries > 0);
+ draw_collect_primitives_generated(draw,
+ lp->active_primgen_queries &&
+ !lp->queries_disabled);
+
/* draw! */
draw_vbo(draw, info);
diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c
index a4217368fce..276fd3bab78 100644
--- a/src/gallium/drivers/llvmpipe/lp_query.c
+++ b/src/gallium/drivers/llvmpipe/lp_query.c
@@ -361,6 +361,7 @@ llvmpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
pq->num_primitives_generated = llvmpipe->so_stats.primitives_storage_needed;
+ llvmpipe->active_primgen_queries++;
break;
case PIPE_QUERY_SO_STATISTICS:
pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
@@ -408,6 +409,8 @@ llvmpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
llvmpipe->so_stats.num_primitives_written - pq->num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
+ assert(llvmpipe->active_primgen_queries);
+ llvmpipe->active_primgen_queries--;
pq->num_primitives_generated =
llvmpipe->so_stats.primitives_storage_needed - pq->num_primitives_generated;
break;