[Mesa-dev] [PATCH 02/12] mesa: Rearrange array type checking, filter more types in ES
Ian Romanick
idr at freedesktop.org
Wed Aug 22 19:26:15 PDT 2012
From: Ian Romanick <ian.d.romanick at intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/main/varray.c | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 327fabb..36d0eb8 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -133,16 +133,26 @@ update_array(struct gl_context *ctx,
GLsizei elementSize;
GLenum format = GL_RGBA;
- if (ctx->API != API_OPENGLES && ctx->API != API_OPENGLES2) {
- /* fixed point arrays / data is only allowed with OpenGL ES 1.x/2.0 */
+ if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) {
+ /* Once Mesa gets support for GL_OES_vertex_half_float this mask will
+ * change. Adding support for this extension isn't quite as trivial as
+ * we'd like because ES uses a different enum value for GL_HALF_FLOAT.
+ */
+ legalTypesMask &= ~(FIXED_GL_BIT
+ | UNSIGNED_INT_2_10_10_10_REV_BIT
+ | INT_2_10_10_10_REV_BIT
+ | HALF_BIT | DOUBLE_BIT);
+ } else {
+ assert(ctx->API == API_OPENGL);
+
legalTypesMask &= ~FIXED_ES_BIT;
- }
- if (!ctx->Extensions.ARB_ES2_compatibility) {
- legalTypesMask &= ~FIXED_GL_BIT;
- }
- if (!ctx->Extensions.ARB_vertex_type_2_10_10_10_rev) {
- legalTypesMask &= ~(UNSIGNED_INT_2_10_10_10_REV_BIT |
- INT_2_10_10_10_REV_BIT);
+
+ if (!ctx->Extensions.ARB_ES2_compatibility)
+ legalTypesMask &= ~FIXED_GL_BIT;
+
+ if (!ctx->Extensions.ARB_vertex_type_2_10_10_10_rev)
+ legalTypesMask &= ~(UNSIGNED_INT_2_10_10_10_REV_BIT |
+ INT_2_10_10_10_REV_BIT);
}
typeBit = type_to_bit(ctx, type);
--
1.7.6.5
More information about the mesa-dev
mailing list