summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-07-05 00:55:18 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-07-05 00:55:18 +0900
commit1942e29bf7e4df34164ed815ccd77b08cd28ed56 (patch)
tree12e0f90f1a5856bb7eab58e392dda9d362627d10 /src/gallium/drivers
parent194cfc7a4ed86653db34be0e331ad7c23b5334eb (diff)
softpipe: Implement texture blankets.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 4db045cdc3..20ad336b4f 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -162,6 +162,39 @@ softpipe_texture_create(struct pipe_screen *screen,
}
+static struct pipe_texture *
+softpipe_texture_blanket(struct pipe_screen * screen,
+ const struct pipe_texture *base,
+ const unsigned *stride,
+ struct pipe_buffer *buffer)
+{
+ struct softpipe_texture *spt;
+ assert(screen);
+
+ /* Only supports one type */
+ if (base->target != PIPE_TEXTURE_2D ||
+ base->last_level != 0 ||
+ base->depth[0] != 1) {
+ return NULL;
+ }
+
+ spt = CALLOC_STRUCT(softpipe_texture);
+ if (!spt)
+ return NULL;
+
+ spt->base = *base;
+ spt->base.refcount = 1;
+ spt->base.screen = screen;
+ spt->base.nblocksx[0] = pf_get_nblocksx(&spt->base.block, spt->base.width[0]);
+ spt->base.nblocksy[0] = pf_get_nblocksy(&spt->base.block, spt->base.height[0]);
+ spt->stride[0] = stride[0];
+
+ pipe_buffer_reference(screen->winsys, &spt->buffer, buffer);
+
+ return &spt->base;
+}
+
+
static void
softpipe_texture_release(struct pipe_screen *screen,
struct pipe_texture **pt)
@@ -309,6 +342,7 @@ void
softpipe_init_screen_texture_funcs(struct pipe_screen *screen)
{
screen->texture_create = softpipe_texture_create;
+ screen->texture_blanket = softpipe_texture_blanket;
screen->texture_release = softpipe_texture_release;
screen->get_tex_surface = softpipe_get_tex_surface;