mesa/es: Validate glPointParameter pname in Mesa code rather than the ES wrapper
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 28 Jul 2012 00:43:22 +0000 (17:43 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 29 Aug 2012 22:09:36 +0000 (15:09 -0700)
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/APIspec.xml
src/mesa/main/es1_conversion.c
src/mesa/main/points.c

index 947ece20cc2109f5c288590ae6a491f6639900c0..a65c5c5297fed521cd023f1dcf9acaa6fc5c74d2 100644 (file)
                        <param name="param" type="GLtype"/>
                </vector>
        </proto>
-
-       <desc name="pname">
-               <value name="GL_POINT_SIZE_MIN"/>
-               <value name="GL_POINT_SIZE_MAX"/>
-               <value name="GL_POINT_FADE_THRESHOLD_SIZE"/>
-
-               <desc name="params" vector_size="1"/>
-       </desc>
-
-       <desc name="pname">
-               <value name="GL_POINT_DISTANCE_ATTENUATION"/>
-               <desc name="params" vector_size="3"/>
-       </desc>
 </template>
 
 <template name="VertexAttrib">
index d79358944398f1d79235a32249ae4ae190566913..ae3c5badce4c419eab0a2c55db52309dbc3981eb 100644 (file)
@@ -676,17 +676,6 @@ _es_Orthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top,
 void GL_APIENTRY
 _es_PointParameterx(GLenum pname, GLfixed param)
 {
-   switch(pname) {
-   case GL_POINT_SIZE_MIN:
-   case GL_POINT_SIZE_MAX:
-   case GL_POINT_FADE_THRESHOLD_SIZE:
-      break;
-   default:
-      _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
-                  "glPointParameterx(pname=0x%x)", pname);
-      return;
-   }
-
    _mesa_PointParameterf(pname, (GLfloat) (param / 65536.0f));
 }
 
index eeb1b44339c79c927189c2b020f56bdb926ee27e..d66af2fa15620232ca66f6b134eadbc8776e996e 100644 (file)
@@ -171,7 +171,7 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params)
          * differ.  In ARB_point_sprite the POINT_SPRITE_R_MODE is
          * always ZERO.  NV_point_sprite adds the S and R modes.
          */
-         if (ctx->Extensions.NV_point_sprite) {
+         if (_mesa_is_desktop_gl(ctx) && ctx->Extensions.NV_point_sprite) {
             GLenum value = (GLenum) params[0];
             if (value != GL_ZERO && value != GL_S && value != GL_R) {
                _mesa_error(ctx, GL_INVALID_VALUE,