freedreno/a6xx: use firstIndex field
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 25 Jun 2020 10:32:24 +0000 (12:32 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 26 Jun 2020 10:05:24 +0000 (10:05 +0000)
Analogous to the turnip change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5644>

src/gallium/drivers/freedreno/a6xx/fd6_draw.c

index fbad52204a7adf171689eb575dfcb0a3e8997fa1..d221009726e88964a59f09a53017ceb9c6316e87 100644 (file)
@@ -82,16 +82,15 @@ draw_emit(struct fd_ringbuffer *ring,
                assert(!info->has_user_indices);
 
                struct pipe_resource *idx_buffer = info->index.resource;
-               uint32_t idx_offset = index_offset + info->start * info->index_size;
                unsigned max_indices = (idx_buffer->width0 - index_offset) / info->index_size;
 
                OUT_PKT(ring, CP_DRAW_INDX_OFFSET,
                                pack_CP_DRAW_INDX_OFFSET_0(*draw0),
                                CP_DRAW_INDX_OFFSET_1(.num_instances = info->instance_count),
                                CP_DRAW_INDX_OFFSET_2(.num_indices = info->count),
-                               CP_DRAW_INDX_OFFSET_3(0),
+                               CP_DRAW_INDX_OFFSET_3(.first_indx = info->start),
                                A5XX_CP_DRAW_INDX_OFFSET_INDX_BASE(
-                                               fd_resource(idx_buffer)->bo, idx_offset),
+                                               fd_resource(idx_buffer)->bo, index_offset),
                                A5XX_CP_DRAW_INDX_OFFSET_6(.max_indices = max_indices)
                        );
        } else {