st/mesa: fix fallout from xfb changes.
[mesa.git] / src / mesa / state_tracker / st_cb_eglimage.c
index 8c78e5ef47712ef9bb78a6015f45b2f2ec5ec0ea..8531afb29a741b3bfbe27aa446bbdbe842be75ce 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.9
  *
  * Copyright (C) 2010 LunarG Inc.
  *
@@ -26,7 +25,6 @@
  *    Chia-I Wu <olv@lunarg.com>
  */
 
-#include "main/mfeatures.h"
 #include "main/texobj.h"
 #include "main/teximage.h"
 #include "util/u_inlines.h"
@@ -98,10 +96,11 @@ st_bind_surface(struct gl_context *ctx, GLenum target,
                 struct gl_texture_image *texImage,
                 struct pipe_surface *ps)
 {
+   struct st_context *st = st_context(ctx);
    struct st_texture_object *stObj;
    struct st_texture_image *stImage;
    GLenum internalFormat;
-   gl_format texFormat;
+   mesa_format texFormat;
 
    /* map pipe format to base format */
    if (util_format_get_component_bits(ps->format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0)
@@ -126,14 +125,15 @@ st_bind_surface(struct gl_context *ctx, GLenum target,
 
    /* FIXME create a non-default sampler view from the pipe_surface? */
    pipe_resource_reference(&stObj->pt, ps->texture);
-   pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+   st_texture_release_all_sampler_views(st, stObj);
    pipe_resource_reference(&stImage->pt, stObj->pt);
 
    stObj->width0 = ps->width;
    stObj->height0 = ps->height;
    stObj->depth0 = 1;
+   stObj->surface_format = ps->format;
 
-   _mesa_dirty_texobj(ctx, texObj, GL_TRUE);
+   _mesa_dirty_texobj(ctx, texObj);
 }
 
 static void