[Mesa-dev] [PATCH 2/3] mesa: Simplify the update_array_format() tests some more
Ian Romanick
idr at freedesktop.org
Thu Mar 5 14:56:40 PST 2015
This patch is
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
On 03/05/2015 10:56 AM, Fredrik Höglund wrote:
> Use the typeBit instead of the type when comparing against multiple
> data types.
> ---
> src/mesa/main/varray.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
> index efc1431..3571f7d 100644
> --- a/src/mesa/main/varray.c
> +++ b/src/mesa/main/varray.c
> @@ -301,9 +301,9 @@ update_array_format(struct gl_context *ctx,
> * ...
> * • size is BGRA and normalized is FALSE;"
> */
> - if (type != GL_UNSIGNED_INT_2_10_10_10_REV &&
> - type != GL_INT_2_10_10_10_REV &&
> - type != GL_UNSIGNED_BYTE) {
> + if (typeBit & ~(UNSIGNED_INT_2_10_10_10_REV_BIT |
> + INT_2_10_10_10_REV_BIT |
> + UNSIGNED_BYTE_BIT)) {
> _mesa_error(ctx, GL_INVALID_OPERATION, "%s(size=GL_BGRA and type=%s)",
> func, _mesa_lookup_enum_by_nr(type));
> return false;
> @@ -323,8 +323,8 @@ update_array_format(struct gl_context *ctx,
> return false;
> }
>
> - if ((type == GL_UNSIGNED_INT_2_10_10_10_REV ||
> - type == GL_INT_2_10_10_10_REV) && size != 4) {
> + if (typeBit & (UNSIGNED_INT_2_10_10_10_REV_BIT |
> + INT_2_10_10_10_REV_BIT) && size != 4) {
> _mesa_error(ctx, GL_INVALID_OPERATION, "%s(size=%d)", func, size);
> return false;
> }
>
More information about the mesa-dev
mailing list