summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_inlines.h
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-05-01 11:07:21 +0100
committerKeith Whitwell <[email protected]>2008-05-01 12:00:45 +0100
commitc9ed86a96483063f3d6789ed16645a3dca77d726 (patch)
tree136ac2158534366c0ca77af7fa4b257155a21f7a /src/gallium/include/pipe/p_inlines.h
parent7584bcf3f746573fc379c7748acc0be96a3db7de (diff)
gallium: tex surface checkpoint
Diffstat (limited to 'src/gallium/include/pipe/p_inlines.h')
-rw-r--r--src/gallium/include/pipe/p_inlines.h31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index 8eb604e73f1..592c3c87c26 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -39,20 +39,6 @@ extern "C" {
#endif
-static INLINE void *
-pipe_surface_map(struct pipe_surface *surface)
-{
- return (char *)surface->winsys->buffer_map( surface->winsys, surface->buffer,
- PIPE_BUFFER_USAGE_CPU_WRITE |
- PIPE_BUFFER_USAGE_CPU_READ )
- + surface->offset;
-}
-
-static INLINE void
-pipe_surface_unmap(struct pipe_surface *surface)
-{
- surface->winsys->buffer_unmap( surface->winsys, surface->buffer );
-}
/**
* Set 'ptr' to point to 'surf' and update reference counting.
@@ -66,9 +52,20 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
if (surf)
surf->refcount++;
- if (*ptr /* && --(*ptr)->refcount == 0 */) {
- struct pipe_winsys *winsys = (*ptr)->winsys;
- winsys->surface_release(winsys, ptr);
+ if (*ptr) {
+
+ /* There are currently two sorts of surfaces... This needs to be
+ * fixed so that all surfaces are views into a texture.
+ */
+ if ((*ptr)->texture) {
+ struct pipe_screen *screen = (*ptr)->texture->screen;
+ screen->tex_surface_release( screen, ptr );
+ }
+ else {
+ struct pipe_winsys *winsys = (*ptr)->winsys;
+ winsys->surface_release(winsys, ptr);
+ }
+
assert(!*ptr);
}