mesa/es: Validate TexCoordPointer types in Mesa code rather than the ES wrapper
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 25 Jul 2012 22:13:00 +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 48127582e5f92b574b4c81fd5d1f899193aedf19..c08a82be4c70ee2a719ebf2e3189c90baafc368c 100644 (file)
                <value name="3"/>
                <value name="4"/>
        </desc>
-
-       <desc name="type">
-               <value name="GL_BYTE"/>
-               <value name="GL_SHORT"/>
-               <value name="GL_FLOAT"/>
-               <value name="GL_FIXED"/>
-               <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/>
-       </desc>
 </template>
 
 <template name="VertexPointer">
index 165b957c8918a3494e66e64ff888c2d9561bf2a7..aacc5c9c3f3107e157e0e59c410e47c4b92998d1 100644 (file)
@@ -354,18 +354,16 @@ void GLAPIENTRY
 _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
                       const GLvoid *ptr)
 {
-   GLbitfield legalTypes = (SHORT_BIT | INT_BIT |
-                            HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
-                            FIXED_ES_BIT |
-                            UNSIGNED_INT_2_10_10_10_REV_BIT |
-                            INT_2_10_10_10_REV_BIT);
    GET_CURRENT_CONTEXT(ctx);
+   GLbitfield legalTypes = (ctx->API == API_OPENGLES)
+      ? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
+      : (SHORT_BIT | INT_BIT |
+         HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
+         UNSIGNED_INT_2_10_10_10_REV_BIT |
+         INT_2_10_10_10_REV_BIT);
    const GLuint unit = ctx->Array.ActiveTexture;
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
-   if (ctx->API == API_OPENGLES)
-      legalTypes |= BYTE_BIT;
-
    update_array(ctx, "glTexCoordPointer", VERT_ATTRIB_TEX(unit),
                 legalTypes, 1, 4,
                 size, type, stride, GL_FALSE, GL_FALSE,