summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/glx')
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index 7e915567a43..607584f0195 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -1368,12 +1368,12 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
internal_format = choose_pixel_format(drawable->xm_visual);
- tex_xfer = pipe_get_transfer(pipe, res,
- 0, 0, /* level, layer */
- PIPE_TRANSFER_WRITE,
- x, y,
- w, h);
- if (!tex_xfer)
+ map = pipe_transfer_map(pipe, res,
+ 0, 0, /* level, layer */
+ PIPE_TRANSFER_WRITE,
+ x, y,
+ w, h, &tex_xfer);
+ if (!map)
return;
/* Grab the XImage that we want to turn into a texture. */
@@ -1385,14 +1385,7 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
ZPixmap);
if (!img) {
- pipe_transfer_destroy(pipe, tex_xfer);
- return;
- }
-
- map = pipe_transfer_map(pipe, tex_xfer);
-
- if (!map) {
- pipe_transfer_destroy(pipe, tex_xfer);
+ pipe_transfer_unmap(pipe, tex_xfer);
return;
}
@@ -1407,8 +1400,6 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
pipe_transfer_unmap(pipe, tex_xfer);
- pipe_transfer_destroy(pipe, tex_xfer);
-
st->teximage(st,
ST_TEXTURE_2D,
0, /* level */