summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>2008-03-12 18:40:37 +0100
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>2008-03-12 18:40:37 +0100
commit6bd5e5ce00b1870a8d94337cc10faa8134cbefd5 (patch)
tree2befe340a7c52f7d43ec3f5b9075e306daccd508 /src/gallium
parent169912b71a4242389301890ef303046d49ce71df (diff)
nv30: line up the miptree creation to latest changes.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nv30/nv30_miptree.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c
index 23bcef08eb..19945e9ab8 100644
--- a/src/gallium/drivers/nv30/nv30_miptree.c
+++ b/src/gallium/drivers/nv30/nv30_miptree.c
@@ -54,27 +54,29 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
nv30mt->total_size = offset;
}
-static void
-nv30_miptree_create(struct pipe_screen *screen, struct pipe_texture **pt)
+static struct pipe_texture *
+nv30_miptree_create(struct pipe_screen *screen, struct pipe_texture *pt)
{
struct pipe_winsys *ws = screen->winsys;
- struct nv30_miptree *nv30mt;
+ struct nv30_miptree *mt;
- nv30mt = realloc(*pt, sizeof(struct nv30_miptree));
- if (!nv30mt)
- return;
- *pt = NULL;
+ mt = MALLOC(sizeof(struct nv30_miptree));
+ if (!mt)
+ return NULL;
+ mt->base = *pt;
+ mt->base.refcount = 1;
+ mt->base.screen = screen;
- nv30_miptree_layout(nv30mt);
+ nv30_miptree_layout(mt);
- nv30mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
- nv30mt->total_size);
- if (!nv30mt->buffer) {
- free(nv30mt);
- return;
+ mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+ mt->total_size);
+ if (!mt->buffer) {
+ free(mt);
+ return NULL;
}
- *pt = &nv30mt->base;
+ return &mt->base;
}
static void