summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/es1_conversion.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-07-26 18:04:50 -0700
committerIan Romanick <[email protected]>2012-08-23 10:15:30 -0700
commitb3dd524a1082efd12d4a796122c300a61ba016d9 (patch)
tree35587a2c38740fe91d831a7b9de62525dd04e90c /src/mesa/main/es1_conversion.c
parent4269cace7944b465860213acbaf82ffddb91efcb (diff)
mesa/es: Validate glTexParameter pnames in Mesa code rather than the ES wrapper
This also adds a missing extension (and API) check around GL_TEXTURE_CROP_RECT_OES. v2: Add proper core-profile, GLES1, and GLES3 filtering. GL_TEXTURE_MAX_LEVEL is (incorrectly) accepted in ES contexts. A future patch will add GL_APPLE_texture_max_level, and meta really needs this. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/main/es1_conversion.c')
-rw-r--r--src/mesa/main/es1_conversion.c44
1 files changed, 3 insertions, 41 deletions
diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c
index 247a038dc8d..75cdfc88711 100644
--- a/src/mesa/main/es1_conversion.c
+++ b/src/mesa/main/es1_conversion.c
@@ -1237,41 +1237,11 @@ _check_TexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params)
void GL_APIENTRY
_es_TexParameterx(GLenum target, GLenum pname, GLfixed param)
{
- GLfloat converted_param;
- bool convert_param_value = true;
-
- switch(pname) {
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- convert_param_value = false;
- break;
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- convert_param_value = false;
- break;
- case GL_GENERATE_MIPMAP:
- if (param != GL_TRUE && param != GL_FALSE) {
- _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
- "glTexParameterx(pname=0x%x)", pname);
- return;
- }
- convert_param_value = false;
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- break;
- default:
- _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
- "glTexParameterx(pname=0x%x)", pname);
- return;
- }
-
- if (convert_param_value) {
- converted_param = (GLfloat) (param / 65536.0f);
+ if (pname == GL_TEXTURE_MAX_ANISOTROPY_EXT) {
+ _mesa_TexParameterf(target, pname, (GLfloat) (param / 65536.0f));
} else {
- converted_param = (GLfloat) param;
+ _mesa_TexParameterf(target, pname, (GLfloat) param);
}
-
- _mesa_TexParameterf(target, pname, converted_param);
}
void GL_APIENTRY
@@ -1300,15 +1270,7 @@ _es_TexParameterxv(GLenum target, GLenum pname, const GLfixed *params)
break;
case GL_TEXTURE_MIN_FILTER:
case GL_TEXTURE_MAG_FILTER:
- convert_params_value = false;
- n_params = 1;
- break;
case GL_GENERATE_MIPMAP:
- if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
- _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
- "glTexParameterxv(pname=0x%x)", pname);
- return;
- }
convert_params_value = false;
n_params = 1;
break;