diff options
author | Jakob Bornecrantz <jakob@tungstengraphics.com> | 2008-06-24 14:19:30 +0200 |
---|---|---|
committer | Jakob Bornecrantz <jakob@tungstengraphics.com> | 2008-06-24 14:33:28 +0200 |
commit | 19dad109bb7b271e0bb4b55e1374c299770b107e (patch) | |
tree | f0918c1d9069c8108a30836fe0792f3ea61816fd /src | |
parent | 2d11411b19f725591e096b8a75dec94831d7bce7 (diff) |
i915: Added texture_blanket function
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/i915simple/i915_texture.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gallium/drivers/i915simple/i915_texture.c b/src/gallium/drivers/i915simple/i915_texture.c index ae107c6676..9d8a6d6de4 100644 --- a/src/gallium/drivers/i915simple/i915_texture.c +++ b/src/gallium/drivers/i915simple/i915_texture.c @@ -677,6 +677,39 @@ i915_get_tex_surface(struct pipe_screen *screen, return ps; } +static struct pipe_texture * +i915_texture_blanket(struct pipe_screen * screen, + const struct pipe_texture *base, + const unsigned *pitch, + struct pipe_buffer *buffer) +{ + struct i915_texture *tex; + assert(screen); + assert(templat); + + /* Only supports one type */ + if (base->target != PIPE_TEXTURE_2D || + base->last_level != 0 || + base->depth[0] != 1) { + return NULL; + } + + tex = CALLOC_STRUCT(i915_texture); + if (!tex) + return NULL; + + tex->base = *base; + + tex->pitch = pitch[0]; + + i915_miptree_set_level_info(tex, 0, 1, base->width[0], base->height[0], 1); + i915_miptree_set_image_offset(tex, 0, 0, 0, 0); + + pipe_buffer_reference(screen->winsys, &tex->buffer, buffer); + + return &tex->base; +} + void i915_init_texture_functions(struct i915_context *i915) { @@ -713,5 +746,6 @@ i915_init_screen_texture_functions(struct pipe_screen *screen) screen->texture_create = i915_texture_create; screen->texture_release = i915_texture_release; screen->get_tex_surface = i915_get_tex_surface; + screen->texture_blanket = i915_texture_blanket; screen->tex_surface_release = i915_tex_surface_release; } |