diff options
author | Brian Paul <[email protected]> | 2011-05-18 08:14:32 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-05-18 08:14:32 -0600 |
commit | 707eadcb7f603e803978a541a16e9893663c33e2 (patch) | |
tree | 1af38f5b21e183952d256c750db42fc68f0574f9 /src/mesa/main/bufferobj.c | |
parent | 496bf04905197dc46c2dffe281008bd7f5edf8a8 (diff) |
mesa: simplify error check in _mesa_MapBufferRange()
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r-- | src/mesa/main/bufferobj.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 78105883c97..3e28d342674 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -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) && |