freedreno/a5xx: Fix indirect draw max_indices calculation
authorEduardo Lima Mitev <elima@igalia.com>
Mon, 10 Jun 2019 21:27:22 +0000 (23:27 +0200)
committerEduardo Lima Mitev <elima@igalia.com>
Tue, 11 Jun 2019 06:28:45 +0000 (08:28 +0200)
The number of elements to draw should not be affected by the offset.

A similar fix was submitted for a6xx at 79180a05.

Fixes these dEQP tests on a5xx:

dEQP-GLES31.functional.draw_indirect.compute_interop.large.drawelements_separate_grid_500x500_drawcount_8
dEQP-GLES31.functional.draw_indirect.compute_interop.large.drawelements_separate_grid_500x500_drawcount_2500
dEQP-GLES31.functional.draw_indirect.compute_interop.large.drawarrays_separate_grid_500x500_drawcount_2500
dEQP-GLES31.functional.draw_indirect.compute_interop.large.drawarrays_combined_grid_500x500_drawcount_2500
dEQP-GLES31.functional.draw_indirect.compute_interop.large.drawelements_combined_grid_500x500_drawcount_8
dEQP-GLES31.functional.draw_indirect.compute_interop.large.drawelements_combined_grid_500x500_drawcount_2500

Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a5xx/fd5_draw.h

index c0d50b29cfdeb037d7efebb8cd4e14581b610117..119ecd4d3adf08b797cffccbf927939ab928f151 100644 (file)
@@ -98,8 +98,7 @@ fd5_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
 
                if (info->index_size) {
                        struct pipe_resource *idx = info->index.resource;
-                       unsigned max_indicies = (idx->width0 - info->indirect->offset) /
-                                       info->index_size;
+                       unsigned max_indicies = idx->width0 / info->index_size;
 
                        OUT_PKT7(ring, CP_DRAW_INDX_INDIRECT, 6);
                        OUT_RINGP(ring, DRAW4(primtype, DI_SRC_SEL_DMA,