Merge branch 'master' of git://anongit.freedesktop.org/mesa/mesa
[mesa.git] / src / gallium / state_trackers / egl / common / egl_g3d_st.c
index 0affe632cfea925362e96748a0dfe7079fb640da..b839f848d7b30defe101889fdc7a4c6e37c97ec6 100644 (file)
@@ -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);
 
@@ -127,7 +126,7 @@ pbuffer_reference_openvg_image(struct egl_g3d_surface *gsurf)
 }
 
 static void
-pbuffer_allocate_render_texture(struct egl_g3d_surface *gsurf)
+pbuffer_allocate_pbuffer_texture(struct egl_g3d_surface *gsurf)
 {
    struct egl_g3d_display *gdpy =
       egl_g3d_display(gsurf->base.Resource.Display);
@@ -140,8 +139,10 @@ 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;
+   /* for rendering and binding to texture */
+   templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
 
    ptex = screen->resource_create(screen, &templ);
    gsurf->render_texture = ptex;
@@ -166,7 +167,7 @@ egl_g3d_st_framebuffer_validate_pbuffer(struct st_framebuffer_iface *stfbi,
       if (!gsurf->render_texture) {
          switch (gsurf->client_buffer_type) {
          case EGL_NONE:
-            pbuffer_allocate_render_texture(gsurf);
+            pbuffer_allocate_pbuffer_texture(gsurf);
             break;
          case EGL_OPENVG_IMAGE:
             pbuffer_reference_openvg_image(gsurf);
@@ -192,7 +193,8 @@ egl_g3d_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi,
    _EGLSurface *surf = (_EGLSurface *) stfbi->st_manager_private;
    struct egl_g3d_surface *gsurf = egl_g3d_surface(surf);
 
-   return gsurf->native->flush_frontbuffer(gsurf->native);
+   return gsurf->native->present(gsurf->native,
+         NATIVE_ATTACHMENT_FRONT_LEFT, FALSE, 0);
 }
 
 static boolean 
@@ -291,6 +293,8 @@ egl_g3d_create_st_framebuffer(_EGLSurface *surf)
       return NULL;
 
    stfbi->visual = &gsurf->stvis;
+   p_atomic_set(&stfbi->stamp, 1);
+
    if (gsurf->base.Type != EGL_PBUFFER_BIT) {
       stfbi->flush_front = egl_g3d_st_framebuffer_flush_front;
       stfbi->validate = egl_g3d_st_framebuffer_validate;