Mesa (master): mesa/es: Validate TexCoordPointer types in Mesa code rather than the ES wrapper
Ian Romanick
idr at kemper.freedesktop.org
Sat Aug 25 02:15:07 UTC 2012
Module: Mesa
Branch: master
Commit: c3e9a207d0cb650045304cac559958d275a63284
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3e9a207d0cb650045304cac559958d275a63284
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Wed Jul 25 15:13:00 2012 -0700
mesa/es: Validate TexCoordPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/main/APIspec.xml | 8 --------
src/mesa/main/varray.c | 14 ++++++--------
2 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
index 4812758..c08a82b 100644
--- a/src/mesa/main/APIspec.xml
+++ b/src/mesa/main/APIspec.xml
@@ -1345,14 +1345,6 @@
<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">
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 165b957..aacc5c9 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -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,
More information about the mesa-commit
mailing list