boolean use_pre_clip_pos;
int pos_idx;
unsigned emitted_primitives;
- unsigned emitted_vertices;
unsigned generated_primitives;
};
}
}
}
- so->emitted_vertices += num_vertices;
++so->emitted_primitives;
}
if (!draw->so.num_targets)
return;
- emit->emitted_vertices = 0;
emit->emitted_primitives = 0;
emit->generated_primitives = 0;
emit->input_vertex_stride = input_verts->stride;
render->set_stream_output_info(render,
emit->emitted_primitives,
- emit->emitted_vertices,
emit->generated_primitives);
}
*/
void (*set_stream_output_info)( struct vbuf_render *vbufr,
unsigned primitive_count,
- unsigned vertices_count,
unsigned primitive_generated );
/**
``PIPE_QUERY_PRIMITIVES_EMITTED`` and
the number of primitives that would have been written to stream output buffers
if they had infinite space available (primitives_storage_needed), in this order.
+XXX the 2nd value is equivalent to ``PIPE_QUERY_PRIMITIVES_GENERATED`` but it is
+unclear if it should be increased if stream output is not active.
``PIPE_QUERY_SO_OVERFLOW_PREDICATE`` returns a boolean value indicating
whether the stream output targets have overflowed as a result of the
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;
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 */
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 =
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
unsigned 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;
}
}
+/*
+ * 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
-sp_vbuf_so_info(struct vbuf_render *vbr, uint primitives, uint vertices,
- uint prim_generated)
+sp_vbuf_so_info(struct vbuf_render *vbr, uint primitives, uint prim_generated)
{
struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr);
struct softpipe_context *softpipe = cvbr->softpipe;
softpipe->so_stats.num_primitives_written += primitives;
- softpipe->so_stats.primitives_storage_needed +=
- vertices * 4 /*sizeof(float|int32)*/ * 4 /*x,y,z,w*/;
- softpipe->num_primitives_generated += prim_generated;
+ softpipe->so_stats.primitives_storage_needed += prim_generated;
}
static void
uint64_t start;
uint64_t end;
struct pipe_query_data_so_statistics so;
- unsigned num_primitives_generated;
-
struct pipe_query_data_pipeline_statistics stats;
};
break;
case PIPE_QUERY_SO_STATISTICS:
sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written;
- sq->so.primitives_storage_needed = softpipe->num_primitives_generated;
+ sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
sq->end = FALSE;
sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- sq->num_primitives_generated = softpipe->num_primitives_generated;
+ sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_TIMESTAMP:
case PIPE_QUERY_GPU_FINISHED:
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
sq->so.num_primitives_written =
softpipe->so_stats.num_primitives_written - sq->so.num_primitives_written;
- sq->num_primitives_generated =
- softpipe->num_primitives_generated - sq->num_primitives_generated;
- sq->end = sq->num_primitives_generated > sq->so.num_primitives_written;
+ sq->so.primitives_storage_needed =
+ softpipe->so_stats.primitives_storage_needed - sq->so.primitives_storage_needed;
+ sq->end = sq->so.primitives_storage_needed > sq->so.num_primitives_written;
break;
case PIPE_QUERY_SO_STATISTICS:
sq->so.num_primitives_written =
softpipe->so_stats.num_primitives_written - sq->so.num_primitives_written;
sq->so.primitives_storage_needed =
- softpipe->num_primitives_generated - sq->so.primitives_storage_needed;
+ softpipe->so_stats.primitives_storage_needed - sq->so.primitives_storage_needed;
break;
case PIPE_QUERY_PRIMITIVES_EMITTED:
sq->so.num_primitives_written =
softpipe->so_stats.num_primitives_written - sq->so.num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- sq->num_primitives_generated =
- softpipe->num_primitives_generated - sq->num_primitives_generated;
+ sq->so.primitives_storage_needed =
+ softpipe->so_stats.primitives_storage_needed - sq->so.primitives_storage_needed;
break;
case PIPE_QUERY_GPU_FINISHED:
case PIPE_QUERY_TIMESTAMP_DISJOINT:
*result = sq->so.num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- *result = sq->num_primitives_generated;
+ *result = sq->so.primitives_storage_needed;
break;
case PIPE_QUERY_OCCLUSION_PREDICATE:
vresult->b = sq->end - sq->start != 0;