mesa/es: Validate VertexPointer types in Mesa code rather than the ES wrapper
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 25 Jul 2012 22:19:31 +0000 (15:19 -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 4657b3c6ef41cdcfeaec7295ee1c8334f9af6f9f..d19a2b02bd1786c800d423700b0afae250cbe706 100644 (file)
                <param name="stride" type="GLsizei"/>
                <param name="pointer" type="const GLvoid *"/>
        </proto>
-
-       <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="PolygonOffset">
index 4269fd25da4dc83fbf2e52d8db08211518221c62..8c3ddc524aaa97b34351fb55d14e735f205412fe 100644 (file)
@@ -249,16 +249,15 @@ update_array(struct gl_context *ctx,
 void GLAPIENTRY
 _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
 {
-   GLbitfield legalTypes = (SHORT_BIT | INT_BIT | FLOAT_BIT |
-                            DOUBLE_BIT | HALF_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 | FLOAT_BIT |
+         DOUBLE_BIT | HALF_BIT |
+         UNSIGNED_INT_2_10_10_10_REV_BIT |
+         INT_2_10_10_10_REV_BIT);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
-   if (ctx->API == API_OPENGLES)
-      legalTypes |= BYTE_BIT;
-
    update_array(ctx, "glVertexPointer", VERT_ATTRIB_POS,
                 legalTypes, 2, 4,
                 size, type, stride, GL_FALSE, GL_FALSE, ptr);