summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/egl')
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d.h3
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d_api.c13
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d_image.c10
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d_st.c4
-rw-r--r--src/gallium/state_trackers/egl/common/native_helper.c20
-rw-r--r--src/gallium/state_trackers/egl/x11/native_dri2.c1
6 files changed, 15 insertions, 36 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.h b/src/gallium/state_trackers/egl/common/egl_g3d.h
index 72c14f0ac4..9873fee6ec 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d.h
+++ b/src/gallium/state_trackers/egl/common/egl_g3d.h
@@ -92,9 +92,8 @@ struct egl_g3d_config {
struct egl_g3d_image {
_EGLImage base;
struct pipe_resource *texture;
- unsigned face;
unsigned level;
- unsigned zslice;
+ unsigned layer;
};
/* standard typecasts */
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
index fd7dc8f814..f505220222 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
@@ -30,6 +30,7 @@
#include "pipe/p_screen.h"
#include "util/u_memory.h"
#include "util/u_inlines.h"
+#include "util/u_box.h"
#include "egl_g3d.h"
#include "egl_g3d_api.h"
@@ -665,15 +666,11 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
ptex = get_pipe_resource(gdpy->native, nsurf, NATIVE_ATTACHMENT_FRONT_LEFT);
if (ptex) {
struct pipe_resource *psrc = gsurf->render_texture;
- struct pipe_subresource subsrc, subdst;
- subsrc.face = 0;
- subsrc.level = 0;
- subdst.face = 0;
- subdst.level = 0;
-
+ struct pipe_box src_box;
+ u_box_origin_2d(ptex->width0, ptex->height0, &src_box);
if (psrc) {
- gdpy->pipe->resource_copy_region(gdpy->pipe, ptex, subdst, 0, 0, 0,
- gsurf->render_texture, subsrc, 0, 0, 0, ptex->width0, ptex->height0);
+ gdpy->pipe->resource_copy_region(gdpy->pipe, ptex, 0, 0, 0, 0,
+ gsurf->render_texture, 0, &src_box);
nsurf->present(nsurf, NATIVE_ATTACHMENT_FRONT_LEFT, FALSE, 0);
}
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 6a1f8cc697..38627a52ec 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_image.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_image.c
@@ -191,7 +191,7 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
{
struct pipe_resource *ptex;
struct egl_g3d_image *gimg;
- unsigned face = 0, level = 0, zslice = 0;
+ unsigned level = 0, layer = 0;
gimg = CALLOC_STRUCT(egl_g3d_image);
if (!gimg) {
@@ -231,7 +231,7 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
FREE(gimg);
return NULL;
}
- if (zslice > ptex->depth0) {
+ if (layer >= (u_minify(ptex->depth0, level) + ptex->array_size - 1)) {
_eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR");
pipe_resource_reference(&gimg->texture, NULL);
FREE(gimg);
@@ -240,9 +240,8 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
/* transfer the ownership to the image */
gimg->texture = ptex;
- gimg->face = face;
gimg->level = level;
- gimg->zslice = zslice;
+ gimg->layer = layer;
return &gimg->base;
}
@@ -288,9 +287,8 @@ egl_g3d_create_drm_image(_EGLDriver *drv, _EGLDisplay *dpy,
/* transfer the ownership to the image */
gimg->texture = ptex;
- gimg->face = 0;
gimg->level = 0;
- gimg->zslice = 0;
+ gimg->layer = 0;
return &gimg->base;
}
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 25e2999590..2b944b521a 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_st.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_st.c
@@ -72,9 +72,8 @@ egl_g3d_st_manager_get_egl_image(struct st_manager *smapi,
out->texture = NULL;
pipe_resource_reference(&out->texture, gimg->texture);
- out->face = gimg->face;
out->level = gimg->level;
- out->zslice = gimg->zslice;
+ out->layer = gimg->layer;
_eglUnlockMutex(&gsmapi->display->Mutex);
@@ -140,6 +139,7 @@ pbuffer_allocate_render_texture(struct egl_g3d_surface *gsurf)
templ.width0 = gsurf->base.Width;
templ.height0 = gsurf->base.Height;
templ.depth0 = 1;
+ templ.array_size = 1;
templ.format = gsurf->stvis.color_format;
templ.bind = PIPE_BIND_RENDER_TARGET;
diff --git a/src/gallium/state_trackers/egl/common/native_helper.c b/src/gallium/state_trackers/egl/common/native_helper.c
index 7832b2b693..0f2d02032b 100644
--- a/src/gallium/state_trackers/egl/common/native_helper.c
+++ b/src/gallium/state_trackers/egl/common/native_helper.c
@@ -40,7 +40,6 @@ struct resource_surface {
uint bind;
struct pipe_resource *resources[NUM_NATIVE_ATTACHMENTS];
- struct pipe_surface *present_surfaces[NUM_NATIVE_ATTACHMENTS];
uint resource_mask;
uint width, height;
};
@@ -67,8 +66,6 @@ resource_surface_free_resources(struct resource_surface *rsurf)
int i;
for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) {
- if (rsurf->present_surfaces[i])
- pipe_surface_reference(&rsurf->present_surfaces[i], NULL);
if (rsurf->resources[i])
pipe_resource_reference(&rsurf->resources[i], NULL);
}
@@ -130,6 +127,7 @@ resource_surface_add_resources(struct resource_surface *rsurf,
templ.width0 = rsurf->width;
templ.height0 = rsurf->height;
templ.depth0 = 1;
+ templ.array_size = 1;
for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) {
if (resource_mask & (1 <<i)) {
@@ -193,8 +191,6 @@ resource_surface_swap_buffers(struct resource_surface *rsurf,
pointer_swap((const void **) &rsurf->resources[buf1],
(const void **) &rsurf->resources[buf2]);
- pointer_swap((const void **) &rsurf->present_surfaces[buf1],
- (const void **) &rsurf->present_surfaces[buf2]);
/* swap mask bits */
mask = rsurf->resource_mask & ~(buf1_bit | buf2_bit);
@@ -212,24 +208,12 @@ resource_surface_present(struct resource_surface *rsurf,
void *winsys_drawable_handle)
{
struct pipe_resource *pres = rsurf->resources[which];
- struct pipe_surface *psurf = rsurf->present_surfaces[which];
if (!pres)
return TRUE;
- if (!psurf) {
- psurf = rsurf->screen->get_tex_surface(rsurf->screen,
- pres, 0, 0, 0, PIPE_BIND_DISPLAY_TARGET);
- if (!psurf)
- return FALSE;
-
- rsurf->present_surfaces[which] = psurf;
- }
-
- assert(psurf->texture == pres);
-
rsurf->screen->flush_frontbuffer(rsurf->screen,
- psurf, winsys_drawable_handle);
+ pres, 0, 0, winsys_drawable_handle);
return TRUE;
}
diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c
index 331a7de432..8108ce4586 100644
--- a/src/gallium/state_trackers/egl/x11/native_dri2.c
+++ b/src/gallium/state_trackers/egl/x11/native_dri2.c
@@ -136,6 +136,7 @@ dri2_surface_process_drawable_buffers(struct native_surface *nsurf,
templ.width0 = dri2surf->width;
templ.height0 = dri2surf->height;
templ.depth0 = 1;
+ templ.array_size = 1;
templ.format = dri2surf->color_format;
templ.bind = PIPE_BIND_RENDER_TARGET;