summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.h1
-rw-r--r--src/gallium/drivers/llvmpipe/lp_query.c12
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_vbuf.c16
3 files changed, 17 insertions, 12 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
index fc948a727fe..106288a6ad3 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
@@ -92,7 +92,6 @@ struct llvmpipe_context {
struct draw_so_target *so_targets[PIPE_MAX_SO_BUFFERS];
int num_so_targets;
struct pipe_query_data_so_statistics so_stats;
- unsigned num_primitives_generated;
struct pipe_query_data_pipeline_statistics pipeline_statistics;
unsigned active_statistics_queries;
diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c
index 4fb707b0233..e6cae160e74 100644
--- a/src/gallium/drivers/llvmpipe/lp_query.c
+++ b/src/gallium/drivers/llvmpipe/lp_query.c
@@ -207,15 +207,15 @@ llvmpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- pq->num_primitives_generated = llvmpipe->num_primitives_generated;
+ pq->num_primitives_generated = llvmpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_SO_STATISTICS:
pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
- pq->num_primitives_generated = llvmpipe->num_primitives_generated;
+ pq->num_primitives_generated = llvmpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
- pq->num_primitives_generated = llvmpipe->num_primitives_generated;
+ pq->num_primitives_generated = llvmpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_PIPELINE_STATISTICS:
/* reset our cache */
@@ -253,19 +253,19 @@ llvmpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
pq->num_primitives_generated =
- llvmpipe->num_primitives_generated - pq->num_primitives_generated;
+ llvmpipe->so_stats.primitives_storage_needed - pq->num_primitives_generated;
break;
case PIPE_QUERY_SO_STATISTICS:
pq->num_primitives_written =
llvmpipe->so_stats.num_primitives_written - pq->num_primitives_written;
pq->num_primitives_generated =
- llvmpipe->num_primitives_generated - pq->num_primitives_generated;
+ llvmpipe->so_stats.primitives_storage_needed - pq->num_primitives_generated;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
pq->num_primitives_written =
llvmpipe->so_stats.num_primitives_written - pq->num_primitives_written;
pq->num_primitives_generated =
- llvmpipe->num_primitives_generated - pq->num_primitives_generated;
+ llvmpipe->so_stats.primitives_storage_needed - pq->num_primitives_generated;
break;
case PIPE_QUERY_PIPELINE_STATISTICS:
pq->stats.ia_vertices =
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
index 9e69591116a..1a1486a49d2 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
@@ -534,17 +534,23 @@ lp_setup_vbuf_destroy(struct vbuf_render *vbr)
lp_setup_destroy(setup);
}
+/*
+ * FIXME: it is unclear if primitives_storage_needed (which is generally
+ * the same as pipe query num_primitives_generated) should increase
+ * if SO is disabled for d3d10, but for GL we definitely need to
+ * increase num_primitives_generated and this is only called for active
+ * SO. If it must not increase for d3d10 need to disambiguate the counters
+ * in the driver and do some work for getting correct values, if it should
+ * increase too should call this from outside streamout code.
+ */
static void
-lp_setup_so_info(struct vbuf_render *vbr, uint primitives, uint vertices,
- uint prim_generated)
+lp_setup_so_info(struct vbuf_render *vbr, uint primitives, uint prim_generated)
{
struct lp_setup_context *setup = lp_setup_context(vbr);
struct llvmpipe_context *lp = llvmpipe_context(setup->pipe);
lp->so_stats.num_primitives_written += primitives;
- lp->so_stats.primitives_storage_needed +=
- vertices * 4 /*sizeof(float|int32)*/ * 4 /*x,y,z,w*/;
- lp->num_primitives_generated += prim_generated;
+ lp->so_stats.primitives_storage_needed += prim_generated;
}
static void