mesa: Refactor common validation code to validate_DrawElements_common
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 11 Nov 2014 09:44:46 +0000 (09:44 +0000)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 2 Dec 2014 20:16:28 +0000 (12:16 -0800)
commit5e72886db0a170d8862f3fc5d8f546fa75b20b2b
tree8a8554540160452999b9f1dff6724fe55e3cd6af
parentb93dcb0e718a0a177370f2c7851223350d3b7bc7
mesa: Refactor common validation code to validate_DrawElements_common

Most of the code in _mesa_validate_DrawElements,
_mesa_validate_DrawRangeElements, and
_mesa_validate_DrawElementsInstanced was the same.  Refactor this out to
common code.

As a side-effect, a bug in _mesa_validate_DrawElementsInstanced was
fixed.  Previously this function would not generate an error when
check_valid_to_render failed if numInstances was 0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/api_validate.c