summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-10-07 15:21:58 -0600
committerBrian Paul <[email protected]>2016-10-13 17:38:49 -0600
commit743a52637258a602eb4ea891b5c3bca0032724c7 (patch)
treec101cb2d6872d74f798c34060f688d47970abe8e /src/mesa
parentd6b00021950a03fc6ff39e63f4c079b956c80c92 (diff)
mesa: add sanity check assertion in update_array_format
At most, one of the normalized, integer, doubles bools can be true. Reviewed-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/varray.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 9acd8686621..0f7777bfe3c 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -333,6 +333,9 @@ update_array_format(struct gl_context *ctx,
GLbitfield typeBit;
GLenum format = GL_RGBA;
+ /* at most, one of these bools can be true */
+ assert((int) normalized + (int) integer + (int) doubles <= 1);
+
if (ctx->Array.LegalTypesMask == 0 || ctx->Array.LegalTypesMaskAPI != ctx->API) {
/* Compute the LegalTypesMask only once, unless the context API has
* changed, in which case we want to compute it again. We can't do this