Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11102>
/* Split draws at the draw call level if the ring is full. This makes
* better use of the ring space.
+ *
+ * If instancing is enabled and there is not enough ring buffer space, compute-based
+ * primitive discard is disabled.
*/
- if (ring_full && num_prims > PRIMS_PER_BATCH &&
- instance_count == 1) { /* TODO: support splitting instanced draws */
+ if (ring_full && num_prims > PRIMS_PER_BATCH && instance_count == 1) {
unsigned vert_count_per_subdraw = 0;
if (prim == PIPE_PRIM_TRIANGLES)
(1 << prim) & ((1 << PIPE_PRIM_TRIANGLES) | (1 << PIPE_PRIM_TRIANGLE_STRIP)) &&
/* Instancing is limited to 16-bit indices, because InstanceID is packed into
VertexID. */
- /* TODO: DrawArraysInstanced doesn't sometimes work, so it's disabled. */
+ /* Instanced index_size == 0 requires that start + count < USHRT_MAX, so just reject it. */
(instance_count == 1 ||
(instance_count <= USHRT_MAX && index_size && index_size <= 2) ||
pd_msg("instance_count too large or index_size == 4 or DrawArraysInstanced"))) &&