const struct _mesa_prim *prim)
{
uint32_t count = count_tessellated_primitives(prim);
+ brw->sol.primitives_generated += count;
if (brw->intel.ctx.TransformFeedback.CurrentObject->Active) {
/* Update brw->sol.svbi_0_max_index to reflect the amount by which the
* hardware is going to increment SVBI 0 when this drawing operation
uint32_t primitives_written = MIN2 (space_avail, count);
brw->sol.svbi_0_starting_index +=
svbi_postincrement_value * primitives_written;
+
+ /* And update the TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN query. */
+ brw->sol.primitives_written += primitives_written;
}
}
}
break;
+ case GL_PRIMITIVES_GENERATED:
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ /* We don't actually query the hardware for this value, so query->bo
+ * should always be NULL and execution should never reach here.
+ */
+ assert(!"Unreachable");
+ break;
+
default:
assert(!"Unrecognized query target in brw_queryobj_get_results()");
break;
intel->stats_wm++;
break;
+ case GL_PRIMITIVES_GENERATED:
+ /* We don't actually query the hardware for this value; we keep track of
+ * it a software counter. So just reset the counter.
+ */
+ brw->sol.primitives_generated = 0;
+ break;
+
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ /* We don't actually query the hardware for this value; we keep track of
+ * it a software counter. So just reset the counter.
+ */
+ brw->sol.primitives_written = 0;
+ break;
+
default:
assert(!"Unrecognized query target in brw_begin_query()");
break;
intel->stats_wm--;
break;
+ case GL_PRIMITIVES_GENERATED:
+ /* We don't actually query the hardware for this value; we keep track of
+ * it in a software counter. So just read the counter and store it in
+ * the query object.
+ */
+ query->Base.Result = brw->sol.primitives_generated;
+
+ /* And set brw->query.obj to NULL so that this query won't try to wait
+ * for any rendering to complete.
+ */
+ query->bo = NULL;
+ break;
+
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ /* We don't actually query the hardware for this value; we keep track of
+ * it in a software counter. So just read the counter and store it in
+ * the query object.
+ */
+ query->Base.Result = brw->sol.primitives_written;
+
+ /* And set brw->query.obj to NULL so that this query won't try to wait
+ * for any rendering to complete.
+ */
+ query->bo = NULL;
+ break;
+
default:
assert(!"Unrecognized query target in brw_end_query()");
break;