summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-07-25 14:53:01 -0700
committerIan Romanick <[email protected]>2012-08-24 19:13:17 -0700
commit07ccfef8d175f6c4b408ee48f7da210975a09fb9 (patch)
tree8d40be46c71b3bb504f8f3a9fa44de542f3b8aca /src/mesa/main/varray.c
parent28ee443d7baea642e267e49c8e74850ecce22a3e (diff)
mesa/es: Validate ColorPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r--src/mesa/main/varray.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index b1d65ed6b90..e64c3c5b0ec 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -285,14 +285,15 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
void GLAPIENTRY
_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
{
- const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
- SHORT_BIT | UNSIGNED_SHORT_BIT |
- INT_BIT | UNSIGNED_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);
+ const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
+ ? (UNSIGNED_BYTE_BIT | HALF_BIT | FLOAT_BIT | FIXED_ES_BIT)
+ : (BYTE_BIT | UNSIGNED_BYTE_BIT |
+ SHORT_BIT | UNSIGNED_SHORT_BIT |
+ INT_BIT | UNSIGNED_INT_BIT |
+ HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
+ UNSIGNED_INT_2_10_10_10_REV_BIT |
+ INT_2_10_10_10_REV_BIT);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
update_array(ctx, "glColorPointer", VERT_ATTRIB_COLOR0,