transform feedback draws get the number of vertices from the transform
feedback object. In draw, we'll figure this out with the number of bytes
written divided by the stride. However, it is apparently possible we end
up with a stride of 0 there (not entirely sure it could happen with GL).
Probably when nothing was actually ever written (so we don't actually
have a stride set). Just avoid the division by zero by setting the count
to 0.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
struct draw_so_target *target =
(struct draw_so_target *)info->count_from_stream_output;
assert(vertex_buffer != NULL);
- info->count = target->internal_offset / vertex_buffer->stride;
+ info->count = vertex_buffer->stride == 0 ? 0 :
+ target->internal_offset / vertex_buffer->stride;
/* Stream output draw can not be indexed */
debug_assert(!info->index_size);