radeonsi: cleanup some primitive discard CS TODOs regarding instancing, etc.
authorMarek Olšák <marek.olsak@amd.com>
Tue, 1 Jun 2021 04:18:51 +0000 (00:18 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 21 Jun 2021 19:03:29 +0000 (19:03 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11102>

src/gallium/drivers/radeonsi/si_compute_prim_discard.c
src/gallium/drivers/radeonsi/si_state_draw.cpp

index 54b58bf..939423e 100644 (file)
@@ -956,9 +956,11 @@ si_prepare_prim_discard_or_split_draw(struct si_context *sctx, const struct pipe
 
    /* 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)
index 52d1087..ce72a53 100644 (file)
@@ -1936,7 +1936,7 @@ static void si_draw_vbo(struct pipe_context *ctx,
            (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"))) &&