Commit 3a830bc4 authored by Keith Whitwell's avatar Keith Whitwell

st/egl: fix up for binding flags

parent c6a80dc3
......@@ -775,7 +775,8 @@ egl_g3d_find_pixmap_config(_EGLDisplay *dpy, EGLNativePixmapType pix)
*/
static struct pipe_surface *
get_pipe_surface(struct native_display *ndpy, struct native_surface *nsurf,
enum native_attachment natt)
enum native_attachment natt,
unsigned bind)
{
struct pipe_resource *textures[NUM_NATIVE_ATTACHMENTS];
struct pipe_surface *psurf;
......@@ -786,7 +787,7 @@ get_pipe_surface(struct native_display *ndpy, struct native_surface *nsurf,
return NULL;
psurf = ndpy->screen->get_tex_surface(ndpy->screen, textures[natt],
0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE);
0, 0, 0, bind);
pipe_resource_reference(&textures[natt], NULL);
return psurf;
......@@ -831,12 +832,13 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
return EGL_FALSE;
}
psurf = get_pipe_surface(gdpy->native, nsurf, NATIVE_ATTACHMENT_FRONT_LEFT);
psurf = get_pipe_surface(gdpy->native, nsurf, NATIVE_ATTACHMENT_FRONT_LEFT,
PIPE_BIND_BLIT_DESTINATION);
if (psurf) {
struct pipe_surface *psrc;
psrc = screen->get_tex_surface(screen, gsurf->render_texture,
0, 0, 0, PIPE_BUFFER_USAGE_GPU_READ);
0, 0, 0, PIPE_BIND_BLIT_SOURCE);
if (psrc) {
gdpy->pipe->surface_copy(gdpy->pipe, psurf, 0, 0,
psrc, 0, 0, psurf->width, psurf->height);
......
......@@ -136,7 +136,7 @@ dri2_surface_process_drawable_buffers(struct native_surface *nsurf,
templ.height0 = dri2surf->height;
templ.depth0 = 1;
templ.format = dri2surf->color_format;
templ.tex_usage = PIPE_BIND_RENDER_TARGET;
templ.bind = PIPE_BIND_RENDER_TARGET;
valid_mask = 0x0;
for (i = 0; i < num_xbufs; i++) {
......@@ -277,7 +277,7 @@ dri2_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask)
templ.height0 = dri2surf->height;
templ.depth0 = 1;
templ.format = dri2surf->color_format;
templ.tex_usage = PIPE_BIND_RENDER_TARGET;
templ.bind = PIPE_BIND_RENDER_TARGET;
for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) {
if (native_attachment_mask_test(buffer_mask, att)) {
......
......@@ -138,17 +138,17 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf,
templ.width0 = xsurf->width;
templ.height0 = xsurf->height;
templ.depth0 = 1;
templ.tex_usage = PIPE_BIND_RENDER_TARGET;
templ.bind = PIPE_BIND_RENDER_TARGET;
if (xsurf->type != XIMAGE_SURFACE_TYPE_PBUFFER) {
switch (which) {
case NATIVE_ATTACHMENT_FRONT_LEFT:
case NATIVE_ATTACHMENT_FRONT_RIGHT:
templ.tex_usage |= PIPE_BIND_SCANOUT;
templ.bind |= PIPE_BIND_SCANOUT;
break;
case NATIVE_ATTACHMENT_BACK_LEFT:
case NATIVE_ATTACHMENT_BACK_RIGHT:
templ.tex_usage |= PIPE_BIND_DISPLAY_TARGET;
templ.bind |= PIPE_BIND_DISPLAY_TARGET;
break;
default:
break;
......@@ -273,7 +273,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment