mesa/es: Validate TexCoordPointer size in Mesa code rather than the ES wrapper
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 25 Jul 2012 22:13:51 +0000 (15:13 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 25 Aug 2012 02:13:18 +0000 (19:13 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/APIspec.xml
src/mesa/main/varray.c

index c08a82be4c70ee2a719ebf2e3189c90baafc368c..0316d4cee7952ee09f9bc17cf7101cf4902fe6ee 100644 (file)
                <param name="stride" type="GLsizei"/>
                <param name="pointer" type="const GLvoid *"/>
        </proto>
-
-       <desc name="size" error="GL_INVALID_VALUE">
-               <value name="2"/>
-               <value name="3"/>
-               <value name="4"/>
-       </desc>
 </template>
 
 <template name="VertexPointer">
index aacc5c9c3f3107e157e0e59c410e47c4b92998d1..4269fd25da4dc83fbf2e52d8db08211518221c62 100644 (file)
@@ -361,11 +361,12 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
          HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
          UNSIGNED_INT_2_10_10_10_REV_BIT |
          INT_2_10_10_10_REV_BIT);
+   const GLint sizeMin = (ctx->API == API_OPENGLES) ? 2 : 1;
    const GLuint unit = ctx->Array.ActiveTexture;
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
    update_array(ctx, "glTexCoordPointer", VERT_ATTRIB_TEX(unit),
-                legalTypes, 1, 4,
+                legalTypes, sizeMin, 4,
                 size, type, stride, GL_FALSE, GL_FALSE,
                 ptr);
 }