summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-07-25 15:19:31 -0700
committerIan Romanick <[email protected]>2012-08-24 19:13:18 -0700
commite2cf14d7b273657cce364236cd041c4ca3f94a6b (patch)
tree2755f9ebc49e8635a85de350f74f71e837bf0d96 /src/mesa/main/varray.c
parentef723ecce42c1823e5a9eb3b9e25be9bd9d66208 (diff)
mesa/es: Validate VertexPointer 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.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 4269fd25da4..8c3ddc524aa 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -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);