diff options
Diffstat (limited to 'src/gallium/winsys/xlib/xlib_softpipe.c')
-rw-r--r-- | src/gallium/winsys/xlib/xlib_softpipe.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index 586e1dfca5d..d8aa4856dc9 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -170,6 +170,8 @@ alloc_shm_ximage(struct xm_buffer *b, struct xmesa_buffer *xmb, (void) XSetErrorHandler(old_handler); return; } + + b->shm = 1; } @@ -230,8 +232,8 @@ xlib_softpipe_display_surface(struct xmesa_buffer *b, struct pipe_surface *surf) { XImage *ximage; - struct xm_buffer *xm_buf = xm_buffer( - softpipe_texture(surf->texture)->buffer); + struct softpipe_texture *spt = softpipe_texture(surf->texture); + struct xm_buffer *xm_buf = xm_buffer(spt->buffer); static boolean no_swap = 0; static boolean firsttime = 1; @@ -244,9 +246,10 @@ xlib_softpipe_display_surface(struct xmesa_buffer *b, return; if (XSHM_ENABLED(xm_buf) && (xm_buf->tempImage == NULL)) { - assert(surf->block.width == 1); - assert(surf->block.height == 1); - alloc_shm_ximage(xm_buf, b, surf->stride/surf->block.size, surf->height); + assert(surf->texture->block.width == 1); + assert(surf->texture->block.height == 1); + alloc_shm_ximage(xm_buf, b, spt->stride[surf->level] / + surf->texture->block.size, surf->height); } ximage = (XSHM_ENABLED(xm_buf)) ? xm_buf->tempImage : b->tempImage; @@ -264,7 +267,7 @@ xlib_softpipe_display_surface(struct xmesa_buffer *b, /* update XImage's fields */ ximage->width = surf->width; ximage->height = surf->height; - ximage->bytes_per_line = surf->stride; + ximage->bytes_per_line = spt->stride[surf->level]; XPutImage(b->xm_visual->display, b->drawable, b->gc, ximage, 0, 0, 0, 0, surf->width, surf->height); |