summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_resource.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-07-14 12:40:04 +0200
committerChristoph Bumiller <[email protected]>2011-07-14 12:51:06 +0200
commitcad17554c4b121c03e188dd0281718a52d603a15 (patch)
treef22e0d7feb5ac3323a659465cef71a16e83705e4 /src/gallium/drivers/nvc0/nvc0_resource.c
parentebeec1d43a7c7b2542ed76326dd3b1814ca47dc8 (diff)
nv50,nvc0: unify nvc0_miptree and nv50_miptree structs
Share some functions and restructure miptree creation a little. Prepare for multi-sample resources.
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_resource.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_resource.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_resource.c b/src/gallium/drivers/nvc0/nvc0_resource.c
index 44e66314e7e..a0289728ee9 100644
--- a/src/gallium/drivers/nvc0/nvc0_resource.c
+++ b/src/gallium/drivers/nvc0/nvc0_resource.c
@@ -21,10 +21,14 @@ nvc0_resource_from_handle(struct pipe_screen * screen,
const struct pipe_resource *templ,
struct winsys_handle *whandle)
{
- if (templ->target == PIPE_BUFFER)
+ if (templ->target == PIPE_BUFFER) {
return NULL;
- else
- return nvc0_miptree_from_handle(screen, templ, whandle);
+ } else {
+ struct pipe_resource *res = nv50_miptree_from_handle(screen,
+ templ, whandle);
+ nv04_resource(res)->vtbl = &nvc0_miptree_vtbl;
+ return res;
+ }
}
void
@@ -37,7 +41,7 @@ nvc0_init_resource_functions(struct pipe_context *pcontext)
pcontext->transfer_destroy = u_transfer_destroy_vtbl;
pcontext->transfer_inline_write = u_transfer_inline_write_vtbl;
pcontext->create_surface = nvc0_miptree_surface_new;
- pcontext->surface_destroy = nvc0_miptree_surface_del;
+ pcontext->surface_destroy = nv50_miptree_surface_del;
}
void