diff options
author | Mathias Fröhlich <[email protected]> | 2018-02-03 15:22:33 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-02-23 05:34:11 +0100 |
commit | 2f351408467a1d2e46927b8df0d3047b67ae2623 (patch) | |
tree | 4f3ba35429173ef3521bc7d2530a7ec9021ddc50 /src/mesa/main/arrayobj.h | |
parent | 8a3a4b6fae75905088ce4fcb42fc50cb09763a10 (diff) |
mesa: Use atomics for shared VAO reference counts.
VAOs will be used in the next change as immutable object across multiple
contexts. Only reference counting may write concurrently on the VAO. So,
make the reference count thread safe for those and only those VAO objects.
v3: Use bool/true/false for gl_vertex_array_object::SharedAndImmutable.
Signed-off-by: Mathias Fröhlich <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/arrayobj.h')
-rw-r--r-- | src/mesa/main/arrayobj.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/arrayobj.h b/src/mesa/main/arrayobj.h index 5de74505bb8..8da5c9ffe01 100644 --- a/src/mesa/main/arrayobj.h +++ b/src/mesa/main/arrayobj.h @@ -81,6 +81,15 @@ extern void _mesa_update_vao_derived_arrays(struct gl_context *ctx, struct gl_vertex_array_object *vao); + +/** + * Mark the vao as shared and immutable, do remaining updates. + */ +extern void +_mesa_set_vao_immutable(struct gl_context *ctx, + struct gl_vertex_array_object *vao); + + /* Returns true if all varying arrays reside in vbos */ extern bool _mesa_all_varyings_in_vbos(const struct gl_vertex_array_object *vao); |