[Mesa-dev] [PATCH] util/draw: replace assertions with conditionals in util_draw_max_index()

Brian Paul brianp at vmware.com
Mon Nov 14 09:08:21 PST 2011


On 11/14/2011 09:47 AM, Jose Fonseca wrote:
> That's verbose enough thanks.
>
>
> BTW, just noticed another problem in the change, the line
>
>    max_index = ~0;
>
> should be replaced with
>
>    max_index = ~0U - 1;
>
> otherwise
>
>    return max_index + 1;
>
> will overflow and return 0 when all elements have stride 0, or are per-instance, causing the draw to be erroneously skipped.

Thanks for catching that.  I'll fix it before pushing.

-Brian



More information about the mesa-dev mailing list