kk: Fix divide by 0 in non-indexed draw unroll

For non-indexed draws, `index_buffer_el_size_B` is 0.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42071>
This commit is contained in:
squidbus 2026-06-07 22:10:17 -07:00 committed by Marge Bot
parent 70caf135d2
commit 43b110dd62

View file

@ -1309,8 +1309,9 @@ kk_unroll_geometry(struct kk_cmd_buffer *cmd, struct kk_draw_command *data)
.in_draw_stride_el = data->indirect_command.stride / sizeof(uint32_t),
/* Handle primitive restart disable by forcing index to UINT32_MAX */
.restart_index = !data->restart ? UINT32_MAX : data->restart_index,
.index_buffer_size_el =
data->index_buffer_range_B / data->index_buffer_el_size_B,
.index_buffer_size_el = data->indexed ? data->index_buffer_range_B /
data->index_buffer_el_size_B
: 0u,
.in_el_size_B = data->index_buffer_el_size_B,
.out_el_size_B = 4u,
.flatshade_first = true,