mesa: fix error handling for glMaterial*
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 20 Sep 2011 05:32:50 +0000 (13:32 +0800)
committerBrian Paul <brianp@vmware.com>
Tue, 20 Sep 2011 14:05:34 +0000 (08:05 -0600)
commita11b4c1e7aa0958e6128bbfae2173e289b2cce8f
treea7cb52729b66958ab3f90c5473bdc57b385a5c12
parenta5f8d37be141fac5c4ac605163a552ac64324e15
mesa: fix error handling for glMaterial*

Trigger GL_INVALID_ENUM error if the face paramter is not a valid value.

Trigger GL_INVALID_VALUE error if the GL_SHININESS value is out side
[0, ctx->Constant.MaxShiniess].

v2: fix the max shininess value.

v3: suggested by Brian, move the face check into glMaterialfv function
    to reduce code duplicate. Also, refactor the error message.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/vbo/vbo_attrib_tmp.h