Mesa (master): mesa: simplify error check in _mesa_MapBufferRange()
Brian Paul
brianp at kemper.freedesktop.org
Wed May 18 14:15:11 UTC 2011
Module: Mesa
Branch: master
Commit: 707eadcb7f603e803978a541a16e9893663c33e2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=707eadcb7f603e803978a541a16e9893663c33e2
Author: Brian Paul <brianp at vmware.com>
Date: Wed May 18 08:14:32 2011 -0600
mesa: simplify error check in _mesa_MapBufferRange()
---
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 7810588..3e28d34 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) &&
More information about the mesa-commit
mailing list