summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-07-27 16:07:19 -0700
committerIan Romanick <[email protected]>2012-08-29 15:09:35 -0700
commitfb4f2d34256aee6b0005b18769a395dd066d3820 (patch)
tree610f616cbe0f528eed4ebbe280f9d4780fcdf4a1 /src/mesa/main
parent8df3f9bd5f7626a4548e9901c0b7af33a21af8a6 (diff)
mesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/APIspec.xml20
-rw-r--r--src/mesa/main/es1_conversion.c17
2 files changed, 5 insertions, 32 deletions
diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
index e7777a7cbcf..baa7abf7f49 100644
--- a/src/mesa/main/APIspec.xml
+++ b/src/mesa/main/APIspec.xml
@@ -126,26 +126,6 @@
<param name="param" type="GLtype"/>
</vector>
</proto>
-
- <desc name="face">
- <value name="GL_FRONT_AND_BACK"/>
- </desc>
-
- <desc name="pname">
- <value name="GL_AMBIENT"/>
- <value name="GL_DIFFUSE"/>
- <value name="GL_AMBIENT_AND_DIFFUSE"/>
- <value name="GL_SPECULAR"/>
- <value name="GL_EMISSION"/>
-
- <desc name="params" vector_size="4"/>
- </desc>
-
- <desc name="pname">
- <value name="GL_SHININESS"/>
-
- <desc name="params" vector_size="1"/>
- </desc>
</template>
<template name="PointSize">
diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c
index c1bcfbe1f57..9b13f13d8a3 100644
--- a/src/mesa/main/es1_conversion.c
+++ b/src/mesa/main/es1_conversion.c
@@ -635,18 +635,13 @@ _es_LoadMatrixx(const GLfixed *m)
void GL_APIENTRY
_es_Materialx(GLenum face, GLenum pname, GLfixed param)
{
- switch(face) {
- case GL_FRONT_AND_BACK:
- break;
- default:
+ if (face != GL_FRONT_AND_BACK) {
_mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
"glMaterialx(face=0x%x)", face);
return;
}
- switch(pname) {
- case GL_SHININESS:
- break;
- default:
+
+ if (pname != GL_SHININESS) {
_mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
"glMaterialx(pname=0x%x)", pname);
return;
@@ -662,14 +657,12 @@ _es_Materialxv(GLenum face, GLenum pname, const GLfixed *params)
unsigned int n_params = 4;
GLfloat converted_params[4];
- switch(face) {
- case GL_FRONT_AND_BACK:
- break;
- default:
+ if (face != GL_FRONT_AND_BACK) {
_mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
"glMaterialxv(face=0x%x)", face);
return;
}
+
switch(pname) {
case GL_AMBIENT:
case GL_DIFFUSE: