summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv20/nv20_miptree.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2009-02-04 20:59:49 +1000
committerBen Skeggs <[email protected]>2009-02-04 21:07:28 +1000
commit79bf0bdc7ffe97ec128e5dd143c4ed54648aae42 (patch)
tree7820f7c1dab91fac877bc36b9a972b3be3e5dfd8 /src/gallium/drivers/nv20/nv20_miptree.c
parentc10fb9579027ae34eda0c52acb353e8da5832495 (diff)
nouveau: get things building/running again after pipe_surface.buffer removal
Don't look at nouveau_winsys_pipe.h... I promise it's temporary!
Diffstat (limited to 'src/gallium/drivers/nv20/nv20_miptree.c')
-rw-r--r--src/gallium/drivers/nv20/nv20_miptree.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c
index 8e4cc809027..89a4058700c 100644
--- a/src/gallium/drivers/nv20/nv20_miptree.c
+++ b/src/gallium/drivers/nv20/nv20_miptree.c
@@ -51,6 +51,30 @@ nv20_miptree_layout(struct nv20_miptree *nv20mt)
}
static struct pipe_texture *
+nv20_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
+ const unsigned *stride, struct pipe_buffer *pb)
+{
+ struct nv20_miptree *mt;
+
+ /* Only supports 2D, non-mipmapped textures for the moment */
+ if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 ||
+ pt->depth[0] != 1)
+ return NULL;
+
+ mt = CALLOC_STRUCT(nv20_miptree);
+ if (!mt)
+ return NULL;
+
+ mt->base = *pt;
+ mt->base.refcount = 1;
+ mt->base.screen = pscreen;
+ mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
+
+ pipe_buffer_reference(pscreen, &mt->buffer, pb);
+ return &mt->base;
+}
+
+static struct pipe_texture *
nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
{
struct pipe_winsys *ws = screen->winsys;
@@ -146,6 +170,7 @@ nv20_miptree_surface_release(struct pipe_screen *pscreen,
void nv20_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
pscreen->texture_create = nv20_miptree_create;
+ pscreen->texture_blanket = nv20_miptree_blanket;
pscreen->texture_release = nv20_miptree_release;
pscreen->get_tex_surface = nv20_miptree_surface_get;
pscreen->tex_surface_release = nv20_miptree_surface_release;