summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/p_inlines.h
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2008-01-10 17:44:04 +0100
committerMichel Dänzer <[email protected]>2008-01-14 18:12:58 +0100
commitc76efb96b405e43e3261d1dc9e8812fdb2cfbac8 (patch)
tree001828ee5bca72508f45deacfbb9f2318763ce99 /src/mesa/pipe/p_inlines.h
parenta511200e5f0c384e68258879bab76563d8e01f01 (diff)
Remove mapping fields from struct pipe_surface.
It's now the responsibility of surface users to keep track of their mappings.
Diffstat (limited to 'src/mesa/pipe/p_inlines.h')
-rw-r--r--src/mesa/pipe/p_inlines.h26
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.