diff options
author | Mathias Fröhlich <[email protected]> | 2019-03-14 05:58:43 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2019-03-15 06:06:42 +0100 |
commit | ebc15ecde5b37b6d0fa3adeffa49aae71eb8bd7e (patch) | |
tree | fa7961921bb3a14a753aba1e886ccd56d23d3358 /src/mesa | |
parent | d66faa54b2d7c8ad4ba6815a17d4d4e39b798c1f (diff) |
mesa: Add assert to _mesa_primitive_restart_index.
Make sure the inde_size parameter is meant to be in bytes.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/varray.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index 0be57971bd7..2831720edfc 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -316,6 +316,9 @@ static inline unsigned _mesa_primitive_restart_index(const struct gl_context *ctx, unsigned index_size) { + /* The index_size parameter is menat to be in bytes. */ + assert(index_size == 1 || index_size == 2 || index_size == 4); + /* From the OpenGL 4.3 core specification, page 302: * "If both PRIMITIVE_RESTART and PRIMITIVE_RESTART_FIXED_INDEX are * enabled, the index value determined by PRIMITIVE_RESTART_FIXED_INDEX |