mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-18 01:50:40 +01:00
draw: Add an assertion to varray's version of trim().
Assert that "first" is always smaller than "count" and add reasoning. It would be better to simply fix trim(), but it is used in tight loops right now.
This commit is contained in:
parent
600cd858d4
commit
e34c52da87
1 changed files with 6 additions and 1 deletions
|
|
@ -1,6 +1,11 @@
|
|||
static unsigned trim( unsigned count, unsigned first, unsigned incr )
|
||||
{
|
||||
return count - (count - first) % incr;
|
||||
/*
|
||||
* count either has been trimmed in draw_pt_arrays or is set to
|
||||
* (driver)_fetch_max which is hopefully always larger than first.
|
||||
*/
|
||||
assert(count >= first);
|
||||
return count - (count - first) % incr;
|
||||
}
|
||||
|
||||
static void FUNC(struct draw_pt_front_end *frontend,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue