Mesa (master): freedreno/a6xx: fix vsc assert

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 29 20:18:51 UTC 2020


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Mon May 18 14:14:51 2020 -0700

freedreno/a6xx: fix vsc assert

Fixes a debug build assert seeing with an android app.  Not quite sure
which path was passing us draw_info w/ instance_count==0.  But we should
just treat non-instanced draws as having a single instance.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5091>

---

 src/gallium/drivers/freedreno/a6xx/fd6_vsc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_vsc.c b/src/gallium/drivers/freedreno/a6xx/fd6_vsc.c
index daf97fe48ac..43b8c2753a9 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_vsc.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_vsc.c
@@ -114,12 +114,11 @@ draw_stream_size_bits(const struct pipe_draw_info *info, unsigned num_bins,
 		unsigned prim_strm_bits)
 {
 	unsigned ndwords = prim_strm_bits / dword;
-	assert(info->instance_count > 0);
 	return (bitfield_size_bits(num_bins)    /* bitfield of bins */
 			+ 1                             /* last-instance-bit */
 			+ number_size_bits(ndwords)     /* size of corresponding prim strm */
 			+ 1                             /* checksum */
-			) * info->instance_count;
+			) * MAX2(1, info->instance_count);
 }
 
 void



More information about the mesa-commit mailing list