aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_inlines.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-15 16:50:35 +0200
committermarha <marha@users.sourceforge.net>2012-10-15 16:50:35 +0200
commit54db46582aba2252d544fa3956522f9ef06b49cb (patch)
treee3692fa2c3864c2bd13089d80bbaccb86b5d4825 /mesalib/src/gallium/auxiliary/util/u_inlines.h
parent8223fb176264123c86c0d3eb845973d00fd62cc2 (diff)
downloadvcxsrv-54db46582aba2252d544fa3956522f9ef06b49cb.tar.gz
vcxsrv-54db46582aba2252d544fa3956522f9ef06b49cb.tar.bz2
vcxsrv-54db46582aba2252d544fa3956522f9ef06b49cb.zip
xserver mesa pixman git update 15 oct 2012
xserver: a69429a17bf4630f6e26f61630a1c2b287202627 pixman: d5f2f39319fc358cccda60abe0bc927bd27131c1 mesa: 4004620d34a580c8fdb965d9b640e97453fc8b28
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_inlines.h66
1 files changed, 19 insertions, 47 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_inlines.h b/mesalib/src/gallium/auxiliary/util/u_inlines.h
index 033c100ed..5c6e7eb32 100644
--- a/mesalib/src/gallium/auxiliary/util/u_inlines.h
+++ b/mesalib/src/gallium/auxiliary/util/u_inlines.h
@@ -251,19 +251,8 @@ pipe_buffer_map_range(struct pipe_context *pipe,
u_box_1d(offset, length, &box);
- *transfer = pipe->get_transfer( pipe,
- buffer,
- 0,
- usage,
- &box);
-
- if (*transfer == NULL)
- return NULL;
-
- map = pipe->transfer_map( pipe, *transfer );
+ map = pipe->transfer_map(pipe, buffer, 0, usage, &box, transfer);
if (map == NULL) {
- pipe->transfer_destroy( pipe, *transfer );
- *transfer = NULL;
return NULL;
}
@@ -285,10 +274,7 @@ static INLINE void
pipe_buffer_unmap(struct pipe_context *pipe,
struct pipe_transfer *transfer)
{
- if (transfer) {
- pipe->transfer_unmap(pipe, transfer);
- pipe->transfer_destroy(pipe, transfer);
- }
+ pipe->transfer_unmap(pipe, transfer);
}
static INLINE void
@@ -397,35 +383,29 @@ pipe_buffer_read(struct pipe_context *pipe,
offset, size,
PIPE_TRANSFER_READ,
&src_transfer);
+ if (!map)
+ return;
- if (map)
- memcpy(data, map, size);
-
+ memcpy(data, map, size);
pipe_buffer_unmap(pipe, src_transfer);
}
-static INLINE struct pipe_transfer *
-pipe_get_transfer( struct pipe_context *context,
- struct pipe_resource *resource,
- unsigned level, unsigned layer,
- enum pipe_transfer_usage usage,
- unsigned x, unsigned y,
- unsigned w, unsigned h)
-{
- struct pipe_box box;
- u_box_2d_zslice( x, y, layer, w, h, &box );
- return context->get_transfer( context,
- resource,
- level,
- usage,
- &box );
-}
-
static INLINE void *
-pipe_transfer_map( struct pipe_context *context,
- struct pipe_transfer *transfer )
+pipe_transfer_map(struct pipe_context *context,
+ struct pipe_resource *resource,
+ unsigned level, unsigned layer,
+ enum pipe_transfer_usage usage,
+ unsigned x, unsigned y,
+ unsigned w, unsigned h,
+ struct pipe_transfer **transfer)
{
- return context->transfer_map( context, transfer );
+ struct pipe_box box;
+ u_box_2d_zslice(x, y, layer, w, h, &box);
+ return context->transfer_map(context,
+ resource,
+ level,
+ usage,
+ &box, transfer);
}
static INLINE void
@@ -435,14 +415,6 @@ pipe_transfer_unmap( struct pipe_context *context,
context->transfer_unmap( context, transfer );
}
-
-static INLINE void
-pipe_transfer_destroy( struct pipe_context *context,
- struct pipe_transfer *transfer )
-{
- context->transfer_destroy(context, transfer);
-}
-
static INLINE void
pipe_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
struct pipe_resource *buf)