Module: Mesa
Branch: master
Commit: ef6313ffd3c0e764142ed2df87b52264bd7d4188
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef6313ffd3c0e764142ed2df87b52264bd7d4188

Author: Rob Clark <robdcl...@gmail.com>
Date:   Wed Nov 22 09:45:28 2017 -0500

freedreno/a5xx: correct max_indicies for indirect draws

Signed-off-by: Rob Clark <robdcl...@gmail.com>

---

 src/gallium/drivers/freedreno/a5xx/fd5_draw.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_draw.h 
b/src/gallium/drivers/freedreno/a5xx/fd5_draw.h
index d1069157e7..3edfc391fd 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_draw.h
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_draw.h
@@ -97,7 +97,8 @@ 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->index_size;
+                       unsigned max_indicies = (idx->width0 - 
info->indirect->offset) /
+                                       info->index_size;
 
                        OUT_PKT7(ring, CP_DRAW_INDX_INDIRECT, 6);
                        OUT_RINGP(ring, DRAW4(primtype, DI_SRC_SEL_DMA,

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to