diff options
Diffstat (limited to 'src/gallium/state_trackers/egl/x11/native_ximage.c')
-rw-r--r-- | src/gallium/state_trackers/egl/x11/native_ximage.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 216de53f744..1b28dbce772 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -65,7 +65,7 @@ struct ximage_display { }; struct ximage_buffer { - struct pipe_texture *texture; + struct pipe_resource *texture; struct xlib_drawable xdraw; }; @@ -116,7 +116,7 @@ ximage_surface_free_buffer(struct native_surface *nsurf, struct ximage_surface *xsurf = ximage_surface(nsurf); struct ximage_buffer *xbuf = &xsurf->buffers[which]; - pipe_texture_reference(&xbuf->texture, NULL); + pipe_resource_reference(&xbuf->texture, NULL); } static boolean @@ -126,7 +126,7 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf, struct ximage_surface *xsurf = ximage_surface(nsurf); struct ximage_buffer *xbuf = &xsurf->buffers[which]; struct pipe_screen *screen = xsurf->xdpy->base.screen; - struct pipe_texture templ; + struct pipe_resource templ; /* free old data */ if (xbuf->texture) @@ -138,22 +138,21 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf, templ.width0 = xsurf->width; templ.height0 = xsurf->height; templ.depth0 = 1; - templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; + templ.bind = PIPE_BIND_RENDER_TARGET; switch (which) { case NATIVE_ATTACHMENT_FRONT_LEFT: case NATIVE_ATTACHMENT_FRONT_RIGHT: - templ.tex_usage |= PIPE_TEXTURE_USAGE_SCANOUT; + templ.bind |= PIPE_BIND_SCANOUT; break; case NATIVE_ATTACHMENT_BACK_LEFT: case NATIVE_ATTACHMENT_BACK_RIGHT: - templ.tex_usage |= PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + templ.bind |= PIPE_BIND_DISPLAY_TARGET; break; default: break; } - - xbuf->texture = screen->texture_create(screen, &templ); + xbuf->texture = screen->resource_create(screen, &templ); if (xbuf->texture) { xbuf->xdraw.visual = xsurf->visual.visual; xbuf->xdraw.depth = xsurf->visual.depth; @@ -265,7 +264,7 @@ ximage_surface_draw_buffer(struct native_surface *nsurf, pipe_surface_reference(&xsurf->draw_surface, NULL); psurf = screen->get_tex_surface(screen, - xbuf->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ); + xbuf->texture, 0, 0, 0, PIPE_BIND_DISPLAY_TARGET); if (!psurf) return FALSE; @@ -321,7 +320,7 @@ ximage_surface_swap_buffers(struct native_surface *nsurf) static boolean ximage_surface_validate(struct native_surface *nsurf, uint attachment_mask, - unsigned int *seq_num, struct pipe_texture **textures, + unsigned int *seq_num, struct pipe_resource **textures, int *width, int *height) { struct ximage_surface *xsurf = ximage_surface(nsurf); @@ -342,7 +341,7 @@ ximage_surface_validate(struct native_surface *nsurf, uint attachment_mask, struct ximage_buffer *xbuf = &xsurf->buffers[att]; textures[att] = NULL; - pipe_texture_reference(&textures[att], xbuf->texture); + pipe_resource_reference(&textures[att], xbuf->texture); } } } |