#include "pipe/p_screen.h"
#include "brw_screen.h"
#include "brw_defines.h"
+#include "brw_winsys.h"
enum {
BRW_VIEW_LINEAR,
surface->base.face = id.bits.face;
surface->base.level = id.bits.level;
surface->id = id;
+ surface->cpp = tex->cpp;
+ surface->pitch = tex->pitch;
+ surface->tiling = tex->tiling;
+
+ surface->bo = tex->bo;
+ brw_screen->sws->bo_reference(surface->bo);
pipe_texture_reference( &surface->base.texture, &tex->base );
}
-static void brw_tex_surface_destroy( struct pipe_surface *surface )
+static void brw_tex_surface_destroy( struct pipe_surface *surf )
{
+ struct brw_surface *surface = brw_surface(surf);
+ struct brw_screen *screen = brw_screen(surf->texture->screen);
+
/* Unreference texture, shared buffer:
*/
+ screen->sws->bo_unreference(surface->bo);
+ pipe_texture_reference( &surface->base.texture, NULL );
+
FREE(surface);
}