summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-01-27 21:36:53 +0100
committerMarek Olšák <[email protected]>2014-02-25 16:04:22 +0100
commitd26a065b7496ef69754fde6e4d0006ccb76f7f3a (patch)
tree920ac8779887a57d9fb916cf9ddf95c1b4542981 /src/mesa/main/bufferobj.h
parent4f78e17f6d1dc1eacbb203ea7c5c76b20dc2a311 (diff)
mesa: allow buffers mapped with the persistent flag to be used by the GPU
v2: also fixed InvalidateBufferData, added citations from the 4.4 spec Reviewed-by: Fredrik Höglund <[email protected]>
Diffstat (limited to 'src/mesa/main/bufferobj.h')
-rw-r--r--src/mesa/main/bufferobj.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 174fd608ced..253a386c271 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -44,6 +44,14 @@ _mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
return obj->Pointer != NULL;
}
+/** Can we not use this buffer while mapped? */
+static inline GLboolean
+_mesa_check_disallowed_mapping(const struct gl_buffer_object *obj)
+{
+ return _mesa_bufferobj_mapped(obj) &&
+ !(obj->AccessFlags & GL_MAP_PERSISTENT_BIT);
+}
+
/**
* Is the given buffer object a user-created buffer object?
* Mesa uses default buffer objects in several places. Default buffers