mesa: Include missing header in st_get_mipmap.h.
[mesa.git] / src / mesa / state_tracker / st_cb_eglimage.c
index a924f8722327921c5867a6b12270cf571235cd3b..4aaf91d5a19dd6188a7ed5524f98a0b10c130696 100644 (file)
@@ -74,12 +74,12 @@ st_egl_image_target_renderbuffer_storage(GLcontext *ctx,
                                         struct gl_renderbuffer *rb,
                                         GLeglImageOES image_handle)
 {
-   struct st_context *st = ctx->st;
+   struct st_context *st = st_context(ctx);
    struct st_renderbuffer *strb = st_renderbuffer(rb);
    struct pipe_surface *ps;
    unsigned usage;
 
-   usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_BLIT_SOURCE | PIPE_BIND_BLIT_DESTINATION;
+   usage = PIPE_BIND_RENDER_TARGET;
    ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage);
    if (ps) {
       strb->Base.Width = ps->width;
@@ -129,6 +129,10 @@ st_bind_surface(GLcontext *ctx, GLenum target,
    /* FIXME create a non-default sampler view from the pipe_surface? */
    pipe_resource_reference(&stImage->pt, ps->texture);
 
+   stObj->width0 = ps->width;
+   stObj->height0 = ps->height;
+   stObj->depth0 = 1;
+
    _mesa_dirty_texobj(ctx, texObj, GL_TRUE);
 }
 
@@ -138,11 +142,11 @@ st_egl_image_target_texture_2d(GLcontext *ctx, GLenum target,
                               struct gl_texture_image *texImage,
                               GLeglImageOES image_handle)
 {
-   struct st_context *st = ctx->st;
+   struct st_context *st = st_context(ctx);
    struct pipe_surface *ps;
    unsigned usage;
 
-   usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_BLIT_DESTINATION | PIPE_BIND_BLIT_SOURCE;
+   usage = PIPE_BIND_SAMPLER_VIEW;
    ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage);
    if (ps) {
       st_bind_surface(ctx, target, texObj, texImage, ps);