diff options
Diffstat (limited to 'src/mesa/pipe/p_inlines.h')
-rw-r--r-- | src/mesa/pipe/p_inlines.h | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/mesa/pipe/p_inlines.h b/src/mesa/pipe/p_inlines.h index e7303c45c1b..6976d087f9b 100644 --- a/src/mesa/pipe/p_inlines.h +++ b/src/mesa/pipe/p_inlines.h @@ -33,35 +33,21 @@ #include "p_winsys.h" -static INLINE ubyte * +static INLINE void * pipe_surface_map(struct pipe_surface *surface) { - if (!surface->map_refcount++) { - surface->map - = (ubyte *) surface->winsys->buffer_map( surface->winsys, - surface->buffer, - PIPE_BUFFER_FLAG_WRITE | - PIPE_BUFFER_FLAG_READ ) - + surface->offset; - } - - return surface->map; + return (char *)surface->winsys->buffer_map( surface->winsys, surface->buffer, + PIPE_BUFFER_FLAG_WRITE | + PIPE_BUFFER_FLAG_READ ) + + surface->offset; } static INLINE void pipe_surface_unmap(struct pipe_surface *surface) { - if (surface->map_refcount > 0) { - assert(surface->map); - if (!--surface->map_refcount) { - surface->winsys->buffer_unmap( surface->winsys, - surface->buffer ); - surface->map = NULL; - } - } + surface->winsys->buffer_unmap( surface->winsys, surface->buffer ); } - /** * Set 'ptr' to point to 'surf' and update reference counting. * The old thing pointed to, if any, will be unreferenced first. |