uint32_t offset_0_batch_start;
uint32_t primitives_generated;
uint32_t primitives_written;
+ bool counting_primitives_generated;
+ bool counting_primitives_written;
} sol;
uint32_t render_target_format[MESA_FORMAT_COUNT];
GLuint nr_prims,
const struct _mesa_index_buffer *ib)
{
+ struct brw_context *brw = brw_context(ctx);
+
+ if (brw->sol.counting_primitives_generated ||
+ brw->sol.counting_primitives_written) {
+ /* Counting primitives generated in hardware is not currently
+ * supported, so take the software path. We need to investigate
+ * the *_PRIMITIVES_COUNT registers to allow this to be handled
+ * entirely in hardware.
+ */
+ return false;
+ }
+
if (!can_cut_index_handle_restart_index(ctx, ib)) {
/* The primitive restart index can't be handled, so take
* the software path
* it a software counter. So just reset the counter.
*/
brw->sol.primitives_generated = 0;
+ brw->sol.counting_primitives_generated = true;
break;
case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
* it a software counter. So just reset the counter.
*/
brw->sol.primitives_written = 0;
+ brw->sol.counting_primitives_written = true;
break;
default:
* the query object.
*/
query->Base.Result = brw->sol.primitives_generated;
+ brw->sol.counting_primitives_generated = false;
/* And set brw->query.obj to NULL so that this query won't try to wait
* for any rendering to complete.
* the query object.
*/
query->Base.Result = brw->sol.primitives_written;
+ brw->sol.counting_primitives_written = false;
/* And set brw->query.obj to NULL so that this query won't try to wait
* for any rendering to complete.