diff options
author | Christoph Bumiller <[email protected]> | 2011-10-18 12:08:19 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-10-21 23:00:40 +0200 |
commit | 28271fd00dc5dd83f95b5cb890e0ab2c0ff6159d (patch) | |
tree | 56c6e2ed7a95fb66e0e813bd2016f189d948d0fa /src/gallium/drivers/nvc0/nvc0_resource.c | |
parent | 73ea0e7fd405af2866062492231c84580a306211 (diff) |
nvc0: add support for linear and buffer textures and RTs
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_resource.c')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_resource.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_resource.c b/src/gallium/drivers/nvc0/nvc0_resource.c index a0289728ee9..e8d83ca5d93 100644 --- a/src/gallium/drivers/nvc0/nvc0_resource.c +++ b/src/gallium/drivers/nvc0/nvc0_resource.c @@ -31,6 +31,16 @@ nvc0_resource_from_handle(struct pipe_screen * screen, } } +static struct pipe_surface * +nvc0_surface_create(struct pipe_context *pipe, + struct pipe_resource *pres, + const struct pipe_surface *templ) +{ + if (unlikely(pres->target == PIPE_BUFFER)) + return nv50_surface_from_buffer(pipe, pres, templ); + return nvc0_miptree_surface_new(pipe, pres, templ); +} + void nvc0_init_resource_functions(struct pipe_context *pcontext) { @@ -40,8 +50,8 @@ nvc0_init_resource_functions(struct pipe_context *pcontext) pcontext->transfer_unmap = u_transfer_unmap_vtbl; 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 = nv50_miptree_surface_del; + pcontext->create_surface = nvc0_surface_create; + pcontext->surface_destroy = nv50_surface_destroy; } void |