aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv10/nv10_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/nv10/nv10_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/nv10/nv10_miptree.c')
-rw-r--r--src/gallium/drivers/nv10/nv10_miptree.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv10/nv10_miptree.c b/src/gallium/drivers/nv10/nv10_miptree.c
index 909278213ee..bbd4b1e15cf 100644
--- a/src/gallium/drivers/nv10/nv10_miptree.c
+++ b/src/gallium/drivers/nv10/nv10_miptree.c
@@ -51,6 +51,30 @@ nv10_miptree_layout(struct nv10_miptree *nv10mt)
}
static struct pipe_texture *
+nv10_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
+ const unsigned *stride, struct pipe_buffer *pb)
+{
+ struct nv10_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(nv10_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 *
nv10_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
{
struct pipe_winsys *ws = screen->winsys;
@@ -141,6 +165,7 @@ nv10_miptree_surface_release(struct pipe_screen *screen,
void nv10_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
pscreen->texture_create = nv10_miptree_create;
+ pscreen->texture_blanket = nv10_miptree_blanket;
pscreen->texture_release = nv10_miptree_release;
pscreen->get_tex_surface = nv10_miptree_surface_get;
pscreen->tex_surface_release = nv10_miptree_surface_release;