mesa/main: Check for 0 size draws after validation.
authorFabian Bieler <fabianbieler@fastmail.fm>
Sat, 25 May 2013 11:33:42 +0000 (13:33 +0200)
committerPaul Berry <stereotype441@gmail.com>
Tue, 27 Aug 2013 22:11:52 +0000 (15:11 -0700)
commitcd18269705c948f5141478a48cf82a1fddd06b83
treef7c6f2b21de6839aaf9252172c63267b2e0571bd
parentac74de37109b62ca092827ca263de1935e2d1c08
mesa/main: Check for 0 size draws after validation.

When validating draw parameters move check for 0 draw count last
(drawing with count 0 is not an error), so that other parameters (e.g.: the
primitive type) are validated and the correct errors (if applicable) are
generated.

>From the OpenGL 3.3 spec page 33 (page 48 of the PDF):
"[Regarding DrawArraysOneInstance, in terms of which other draw operations
are defined:]
If count is negative, an INVALID_VALUE error is generated."

This patch also changes the bahavior of MultiDrawElements to perform the draw
operation if some primitive's index counts are zero.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/main/api_validate.c
src/mesa/vbo/vbo_exec_array.c