mesa: Make enable.c and get.c properly range check clip flags.
authorPaul Berry <stereotype441@gmail.com>
Sun, 25 Sep 2011 18:55:41 +0000 (11:55 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 27 Sep 2011 17:36:38 +0000 (10:36 -0700)
commitb565e62a4499aad445bdbc0ba3a8bbc1c61e68ab
tree4d9950bae6334679b510e59a44bb905b723d1a47
parent4c84fbea9d496567d706468113d63cd8f0faeb7f
mesa: Make enable.c and get.c properly range check clip flags.

This is a follow-up to commit
2d686fe911a89fa477ee3848da41ebfb100500bf, which added decoding of
GL_CLIP_DISTANCE[67] to the _mesa_set_enable() function.  This patch
makes the following additional fixes:

- Uses GL_CLIP_DISTANCEi enums consistently within enable.c rather
  than the deprecated GL_CLIP_PLANEi enums.

- Generates an error if the user tries to access a clip flag that is
  unsupported by the hardware.

- Applies the same change to _mesa_IsEnabled(), so that querying clip
  flags using glIsEnabled() works properly.

- Applies corresponding changes to get.c, so that querying clip flags
  using glGet*() works properly.

Fixes piglit test clip-flag-behavior.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/enable.c
src/mesa/main/get.c