mesa/es: Validate ColorPointer size in Mesa code rather than the ES wrapper
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 25 Jul 2012 21:58:36 +0000 (14:58 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 25 Aug 2012 02:13:17 +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 5201647ffedc73df1175f54e51e9151a37ade682..3d5f52146403f60f348653be5635a9db2243d7d2 100644 (file)
                <param name="stride" type="GLsizei"/>
                <param name="pointer" type="const GLvoid *"/>
        </proto>
-
-       <desc name="size" error="GL_INVALID_VALUE">
-               <value name="4"/>
-       </desc>
 </template>
 
 <template name="DisableClientState">
index e64c3c5b0ec28fdfeb63d1ba7471b6b6ebfbf277..f3c869f6d7f4b38d012b5bddc399d150ce12a4c5 100644 (file)
@@ -294,10 +294,11 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
          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) ? 4 : 3;
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
    update_array(ctx, "glColorPointer", VERT_ATTRIB_COLOR0,
-                legalTypes, 3, BGRA_OR_4,
+                legalTypes, sizeMin, BGRA_OR_4,
                 size, type, stride, GL_TRUE, GL_FALSE, ptr);
 }