diff options
Diffstat (limited to 'src/gallium/state_trackers/egl/common')
-rw-r--r-- | src/gallium/state_trackers/egl/common/egl_g3d.c | 16 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/common/egl_g3d.h | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/common/egl_g3d_image.c | 12 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/common/egl_g3d_st.c | 22 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/common/native.h | 2 |
5 files changed, 29 insertions, 27 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 8e39a85..efddf56 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -667,7 +667,7 @@ destroy_surface(_EGLDisplay *dpy, _EGLSurface *surf) if (!dpy->Initialized) _eglLog(_EGL_FATAL, "destroy a surface with an unitialized display"); - pipe_texture_reference(&gsurf->render_texture, NULL); + pipe_resource_reference(&gsurf->render_texture, NULL); egl_g3d_destroy_st_framebuffer(gsurf->stfbi); if (gsurf->native) gsurf->native->destroy(gsurf->native); @@ -787,9 +787,10 @@ 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_texture *textures[NUM_NATIVE_ATTACHMENTS]; + struct pipe_resource *textures[NUM_NATIVE_ATTACHMENTS]; struct pipe_surface *psurf; textures[natt] = NULL; @@ -798,8 +799,8 @@ 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); - pipe_texture_reference(&textures[natt], NULL); + 0, 0, 0, bind); + pipe_resource_reference(&textures[natt], NULL); return psurf; } @@ -843,12 +844,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/common/egl_g3d.h b/src/gallium/state_trackers/egl/common/egl_g3d.h index 69bb0b4..67dff53 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.h +++ b/src/gallium/state_trackers/egl/common/egl_g3d.h @@ -73,7 +73,7 @@ struct egl_g3d_surface { /* the native surface; NULL for pbuffers */ struct native_surface *native; - struct pipe_texture *render_texture; + struct pipe_resource *render_texture; unsigned int sequence_number; }; @@ -86,7 +86,7 @@ struct egl_g3d_config { struct egl_g3d_image { _EGLImage base; - struct pipe_texture *texture; + struct pipe_resource *texture; unsigned face; unsigned level; unsigned zslice; diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_image.c b/src/gallium/state_trackers/egl/common/egl_g3d_image.c index d701f9c..e49bcde 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_image.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_image.c @@ -40,13 +40,13 @@ /** * Reference and return the front left buffer of the native pixmap. */ -static struct pipe_texture * +static struct pipe_resource * egl_g3d_reference_native_pixmap(_EGLDisplay *dpy, EGLNativePixmapType pix) { struct egl_g3d_display *gdpy = egl_g3d_display(dpy); struct egl_g3d_config *gconf; struct native_surface *nsurf; - struct pipe_texture *textures[NUM_NATIVE_ATTACHMENTS]; + struct pipe_resource *textures[NUM_NATIVE_ATTACHMENTS]; enum native_attachment natt; gconf = egl_g3d_config(egl_g3d_find_pixmap_config(dpy, pix)); @@ -72,7 +72,7 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attribs) { - struct pipe_texture *ptex; + struct pipe_resource *ptex; struct egl_g3d_image *gimg; unsigned face = 0, level = 0, zslice = 0; @@ -104,13 +104,13 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, if (level > ptex->last_level) { _eglError(EGL_BAD_MATCH, "eglCreateEGLImageKHR"); - pipe_texture_reference(&gimg->texture, NULL); + pipe_resource_reference(&gimg->texture, NULL); free(gimg); return NULL; } if (zslice > ptex->depth0) { _eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR"); - pipe_texture_reference(&gimg->texture, NULL); + pipe_resource_reference(&gimg->texture, NULL); free(gimg); return NULL; } @@ -129,7 +129,7 @@ egl_g3d_destroy_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img) { struct egl_g3d_image *gimg = egl_g3d_image(img); - pipe_texture_reference(&gimg->texture, NULL); + pipe_resource_reference(&gimg->texture, NULL); free(gimg); return EGL_TRUE; diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_st.c b/src/gallium/state_trackers/egl/common/egl_g3d_st.c index 6e5ea96..887c7b0 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_st.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_st.c @@ -107,7 +107,7 @@ egl_g3d_st_manager_get_egl_image(struct st_manager *smapi, gimg = egl_g3d_image(img); stimg->texture = NULL; - pipe_texture_reference(&stimg->texture, gimg->texture); + pipe_resource_reference(&stimg->texture, gimg->texture); stimg->face = gimg->face; stimg->level = gimg->level; stimg->zslice = gimg->zslice; @@ -152,11 +152,11 @@ static boolean egl_g3d_st_framebuffer_validate_pbuffer(struct st_framebuffer_iface *stfbi, const enum st_attachment_type *statts, unsigned count, - struct pipe_texture **out) + struct pipe_resource **out) { _EGLSurface *surf = (_EGLSurface *) stfbi->st_manager_private; struct egl_g3d_surface *gsurf = egl_g3d_surface(surf); - struct pipe_texture templ; + struct pipe_resource templ; unsigned i; for (i = 0; i < count; i++) { @@ -177,12 +177,12 @@ egl_g3d_st_framebuffer_validate_pbuffer(struct st_framebuffer_iface *stfbi, templ.height0 = gsurf->base.Height; templ.depth0 = 1; templ.format = gsurf->stvis.color_format; - templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; + templ.bind = PIPE_BIND_RENDER_TARGET; - gsurf->render_texture = screen->texture_create(screen, &templ); + gsurf->render_texture = screen->resource_create(screen, &templ); } - pipe_texture_reference(&out[i], gsurf->render_texture); + pipe_resource_reference(&out[i], gsurf->render_texture); } return TRUE; @@ -202,11 +202,11 @@ static boolean egl_g3d_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, const enum st_attachment_type *statts, unsigned count, - struct pipe_texture **out) + struct pipe_resource **out) { _EGLSurface *surf = (_EGLSurface *) stfbi->st_manager_private; struct egl_g3d_surface *gsurf = egl_g3d_surface(surf); - struct pipe_texture *textures[NUM_NATIVE_ATTACHMENTS]; + struct pipe_resource *textures[NUM_NATIVE_ATTACHMENTS]; uint attachment_mask = 0; unsigned i; @@ -241,7 +241,7 @@ egl_g3d_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, return FALSE; for (i = 0; i < count; i++) { - struct pipe_texture *tex; + struct pipe_resource *tex; int natt; switch (statts[i]) { @@ -266,7 +266,7 @@ egl_g3d_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, tex = textures[natt]; if (statts[i] == stfbi->visual->render_buffer) - pipe_texture_reference(&gsurf->render_texture, tex); + pipe_resource_reference(&gsurf->render_texture, tex); if (attachment_mask & (1 << natt)) { /* transfer the ownership to the caller */ @@ -275,7 +275,7 @@ egl_g3d_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, } else { /* the attachment is listed more than once */ - pipe_texture_reference(&out[i], tex); + pipe_resource_reference(&out[i], tex); } } } diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h index 7b9bea5..5ab21b6 100644 --- a/src/gallium/state_trackers/egl/common/native.h +++ b/src/gallium/state_trackers/egl/common/native.h @@ -93,7 +93,7 @@ struct native_surface { * behavior might change in the future. */ boolean (*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); /** |