hk: fix patch count = 0 handling

fixes fault in dEQP-VK.tessellation.misc_draw.triangles_no_patches

Backport-to: 25.1
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34612>
This commit is contained in:
Alyssa Rosenzweig 2025-04-18 10:23:36 -04:00 committed by Marge Bot
parent 21b12b540f
commit e541ffcbe8

View file

@ -771,7 +771,7 @@ libagx_prefix_sum_tess(global struct libagx_tess_args *p, global uint *c_prims,
return;
/* The last element of an inclusive prefix sum is the total sum */
uint total = p->counts[p->nr_patches - 1];
uint total = p->nr_patches > 0 ? p->counts[p->nr_patches - 1] : 0;
/* Allocate 4-byte indices */
uint32_t elsize_B = sizeof(uint32_t);