mesa: simplify error check in _mesa_MapBufferRange()
authorBrian Paul <brianp@vmware.com>
Wed, 18 May 2011 14:14:32 +0000 (08:14 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 18 May 2011 14:14:32 +0000 (08:14 -0600)
src/mesa/main/bufferobj.c

index 78105883c97ef48eb863414c95147928505165b6..3e28d3426745a1fd10c7624e4b857f064d73ade9 100644 (file)
@@ -1416,14 +1416,13 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
       return NULL;
    }
 
-   if (access & GL_MAP_READ_BIT) {
-      if ((access & GL_MAP_INVALIDATE_RANGE_BIT) ||
-          (access & GL_MAP_INVALIDATE_BUFFER_BIT) ||
-          (access & GL_MAP_UNSYNCHRONIZED_BIT)) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glMapBufferRange(invalid access flags)");
-         return NULL;
-      }
+   if ((access & GL_MAP_READ_BIT) &&
+       (access & (GL_MAP_INVALIDATE_RANGE_BIT |
+                  GL_MAP_INVALIDATE_BUFFER_BIT |
+                  GL_MAP_UNSYNCHRONIZED_BIT))) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glMapBufferRange(invalid access flags)");
+      return NULL;
    }
 
    if ((access & GL_MAP_FLUSH_EXPLICIT_BIT) &&