summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-03-23 14:00:52 -0700
committerKeith Whitwell <keithw@vmware.com>2010-03-23 14:00:52 -0700
commit3a830bc4a3f0f60c925b9434845a6bcad9a913c5 (patch)
tree0df9fdc14ea96e664efb4e3dc702b40bc02fa8b2
parentc6a80dc32ef17bc972d4137ce7444ebed4d28ebb (diff)
downloadmesa-gallium-buffer-usage-cleanup.tar.gz
st/egl: fix up for binding flagsgallium-buffer-usage-cleanup
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d.c10
-rw-r--r--src/gallium/state_trackers/egl/x11/native_dri2.c4
-rw-r--r--src/gallium/state_trackers/egl/x11/native_ximage.c8
3 files changed, 12 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c
index 4d70fb987a8..4296c57d128 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d.c
@@ -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);
diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c
index e34d8fe542c..5a27c24fd66 100644
--- a/src/gallium/state_trackers/egl/x11/native_dri2.c
+++ b/src/gallium/state_trackers/egl/x11/native_dri2.c
@@ -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)) {
diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c
index 49d0f0f2062..6621f04b758 100644
--- a/src/gallium/state_trackers/egl/x11/native_ximage.c
+++ b/src/gallium/state_trackers/egl/x11/native_ximage.c
@@ -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;