Mesa (master): mesa: improve comment on _mesa_check_disallowed_mapping(), return bool

Brian Paul brianp at kemper.freedesktop.org
Thu Apr 28 15:19:43 UTC 2016


Module: Mesa
Branch: master
Commit: f365488eaaaaab8eb61bc614a105f397c5c80a6f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f365488eaaaaab8eb61bc614a105f397c5c80a6f

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Apr 27 10:42:39 2016 -0600

mesa: improve comment on _mesa_check_disallowed_mapping(), return bool

The old comment was a bit terse.  Also, change the function return
type to bool.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/bufferobj.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index a5bfe88..5dcc553 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -45,8 +45,14 @@ _mesa_bufferobj_mapped(const struct gl_buffer_object *obj,
    return obj->Mappings[index].Pointer != NULL;
 }
 
-/** Can we not use this buffer while mapped? */
-static inline GLboolean
+/**
+ * Check whether the given buffer object is illegally mapped prior to
+ * drawing from (or reading back to) the buffer.
+ * Note that it's legal for a buffer to be mapped at draw/readback time
+ * if it was mapped persistently (See GL_ARB_buffer_storage spec).
+ * \return true if the buffer is illegally mapped, false otherwise
+ */
+static inline bool
 _mesa_check_disallowed_mapping(const struct gl_buffer_object *obj)
 {
    return _mesa_bufferobj_mapped(obj, MAP_USER) &&




More information about the mesa-commit mailing list