summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i965simple
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-08-08 12:23:21 +0100
committerJosé Fonseca <[email protected]>2008-08-08 12:32:23 +0100
commit9dcb956a0618931c97693f7c74493cf296cfe86c (patch)
treeffc076c3e34dffd3dc8de5cf01ccb96939d4b797 /src/gallium/drivers/i965simple
parentbe36f7869e8ecc4b00e414557a9699ba373e6bdd (diff)
gallium: Add destroy callback to all *_winsys interfaces.
For consistency and to simplify these objects' destruction.
Diffstat (limited to 'src/gallium/drivers/i965simple')
-rw-r--r--src/gallium/drivers/i965simple/brw_context.c3
-rw-r--r--src/gallium/drivers/i965simple/brw_screen.c5
-rw-r--r--src/gallium/drivers/i965simple/brw_winsys.h2
3 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/i965simple/brw_context.c b/src/gallium/drivers/i965simple/brw_context.c
index a276cc0535d..8326f7b9c40 100644
--- a/src/gallium/drivers/i965simple/brw_context.c
+++ b/src/gallium/drivers/i965simple/brw_context.c
@@ -52,6 +52,9 @@ static void brw_destroy(struct pipe_context *pipe)
{
struct brw_context *brw = brw_context(pipe);
+ if(brw->winsys->destroy)
+ brw->winsys->destroy(brw->winsys);
+
FREE(brw);
}
diff --git a/src/gallium/drivers/i965simple/brw_screen.c b/src/gallium/drivers/i965simple/brw_screen.c
index 6d8f24d1c49..fadfbf94ab3 100644
--- a/src/gallium/drivers/i965simple/brw_screen.c
+++ b/src/gallium/drivers/i965simple/brw_screen.c
@@ -206,6 +206,11 @@ brw_is_format_supported( struct pipe_screen *screen,
static void
brw_destroy_screen( struct pipe_screen *screen )
{
+ struct pipe_winsys *winsys = screen->winsys;
+
+ if(winsys->destroy)
+ winsys->destroy(winsys);
+
FREE(screen);
}
diff --git a/src/gallium/drivers/i965simple/brw_winsys.h b/src/gallium/drivers/i965simple/brw_winsys.h
index b67bd737502..ec1e400418f 100644
--- a/src/gallium/drivers/i965simple/brw_winsys.h
+++ b/src/gallium/drivers/i965simple/brw_winsys.h
@@ -112,6 +112,8 @@ enum brw_cache_id {
*/
struct brw_winsys {
+ void (*destroy)(struct brw_winsys *);
+
/**
* Reserve space on batch buffer.
*