From 51430c21ffd212d801f129d625f3ae8713372f68 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sat, 10 Apr 2010 19:07:28 +0200 Subject: [PATCH] nv50: plug in miptree resource vtbl --- src/gallium/drivers/nv50/nv50_buffer.c | 2 +- src/gallium/drivers/nv50/nv50_miptree.c | 7 ++++++- src/gallium/drivers/nv50/nv50_resource.h | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_buffer.c b/src/gallium/drivers/nv50/nv50_buffer.c index 094e05e9bbf..0bda7f78fb5 100644 --- a/src/gallium/drivers/nv50/nv50_buffer.c +++ b/src/gallium/drivers/nv50/nv50_buffer.c @@ -67,7 +67,7 @@ static void nv50_buffer_transfer_unmap( struct pipe_context *pipe, -struct u_resource_vtbl nv50_buffer_vtbl = +const struct u_resource_vtbl nv50_buffer_vtbl = { u_default_resource_get_handle, /* get_handle */ nv50_buffer_destroy, /* resource_destroy */ diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 6484f924d0b..b7cd92158fe 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -111,7 +111,7 @@ nv50_miptree_get_handle(struct pipe_screen *pscreen, } -struct u_resource_vtbl nv50_miptree_vtbl = +const struct u_resource_vtbl nv50_miptree_vtbl = { nv50_miptree_get_handle, /* get_handle */ nv50_miptree_destroy, /* resource_destroy */ @@ -137,7 +137,11 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_resource *tmp uint32_t tile_flags; int ret, i, l; + if (!mt) + return NULL; + *pt = *tmp; + mt->base.vtbl = &nv50_miptree_vtbl; pipe_reference_init(&pt->reference, 1); pt->screen = pscreen; @@ -248,6 +252,7 @@ nv50_miptree_from_handle(struct pipe_screen *pscreen, mt->base.base = *template; + mt->base.vtbl = &nv50_miptree_vtbl; pipe_reference_init(&mt->base.base.reference, 1); mt->base.base.screen = pscreen; mt->image_nr = 1; diff --git a/src/gallium/drivers/nv50/nv50_resource.h b/src/gallium/drivers/nv50/nv50_resource.h index 963a1100ce8..6cf7662124b 100644 --- a/src/gallium/drivers/nv50/nv50_resource.h +++ b/src/gallium/drivers/nv50/nv50_resource.h @@ -16,7 +16,7 @@ struct nouveau_bo; */ struct nv50_resource { struct pipe_resource base; - struct u_resource_vtbl *vtbl; + const struct u_resource_vtbl *vtbl; struct nouveau_bo *bo; }; -- 2.30.2