diff options
author | Fredrik Höglund <[email protected]> | 2013-04-12 17:36:06 +0200 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-08-15 21:38:13 -0700 |
commit | 0e7a61a29f883c63a5439ac16edffffdeba3aaf4 (patch) | |
tree | 391352180b4228577da5ee53c231769e0e5d370a | |
parent | 90129da82c91b731c7c65e8e3adbde58d8c62840 (diff) |
mesa: Update the BGRA vertex array error handling
The error code was changed from INVALID_VALUE to INVALID_OPERATION
in OpenGL 3.3. We should also generate an error when size is BGRA
and normalized is FALSE.
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/main/varray.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 529d933246c..dee476abbae 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -196,6 +196,16 @@ update_array(struct gl_context *ctx, if (ctx->Extensions.EXT_vertex_array_bgra && sizeMax == BGRA_OR_4 && size == GL_BGRA) { + /* Page 298 of the PDF of the OpenGL 4.3 (Core Profile) spec says: + * + * "An INVALID_OPERATION error is generated under any of the following + * conditions: + * ... + * • size is BGRA and type is not UNSIGNED_BYTE, INT_2_10_10_10_REV + * or UNSIGNED_INT_2_10_10_10_REV; + * ... + * • size is BGRA and normalized is FALSE;" + */ GLboolean bgra_error = GL_FALSE; if (ctx->Extensions.ARB_vertex_type_2_10_10_10_rev) { @@ -207,9 +217,17 @@ update_array(struct gl_context *ctx, bgra_error = GL_TRUE; if (bgra_error) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(GL_BGRA/GLubyte)", func); + _mesa_error(ctx, GL_INVALID_OPERATION, "%s(size=GL_BGRA and type=%s)", + func, _mesa_lookup_enum_by_nr(type)); return; } + + if (!normalized) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s(size=GL_BGRA and normalized=GL_FALSE)", func); + return; + } + format = GL_BGRA; size = 4; } |