summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i965/brw_screen_surface.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-11-04 20:36:48 +0000
committerKeith Whitwell <[email protected]>2009-11-04 20:36:48 +0000
commitc5ed7b6e76a71d34e4a42ebfca092bd99cb39438 (patch)
treecdeecf7da81d4f85d12abaebdc4c903628a6bf30 /src/gallium/drivers/i965/brw_screen_surface.c
parente18f223da710a6e1f6a08d346951ea66c6a1de99 (diff)
i965g: plumb in some surface state
Diffstat (limited to 'src/gallium/drivers/i965/brw_screen_surface.c')
-rw-r--r--src/gallium/drivers/i965/brw_screen_surface.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/drivers/i965/brw_screen_surface.c b/src/gallium/drivers/i965/brw_screen_surface.c
index 04a6fc7b66d..1c408e9f2e5 100644
--- a/src/gallium/drivers/i965/brw_screen_surface.c
+++ b/src/gallium/drivers/i965/brw_screen_surface.c
@@ -35,6 +35,7 @@
#include "pipe/p_screen.h"
#include "brw_screen.h"
#include "brw_defines.h"
+#include "brw_winsys.h"
enum {
BRW_VIEW_LINEAR,
@@ -145,6 +146,12 @@ static struct brw_surface *create_in_place_view( struct brw_screen *brw_screen,
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 );
@@ -234,10 +241,16 @@ static struct pipe_surface *brw_get_tex_surface(struct pipe_screen *screen,
}
-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);
}