summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_texture.c
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-01-23 17:01:04 -0800
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-02-01 23:30:27 -0800
commit1a5eea0c1e9ce6162ed6b07c337bffe62cb3c221 (patch)
treef9d7fbc6d6c092f76985d83f9eb28968ae0781b8 /src/gallium/drivers/r300/r300_texture.c
parent02c6e523305de017b49d6851034fcea6c568e94c (diff)
r300: Finish basic state setup.
I have successfully fooled glxinfo into believing that I am a competent writer of code. Next step is to trick trivial/clear.
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture.c')
-rw-r--r--src/gallium/drivers/r300/r300_texture.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index c1df905033..4adfe478c3 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -156,10 +156,41 @@ static void r300_tex_surface_release(struct pipe_screen* screen,
*surface = NULL;
}
+static struct pipe_texture*
+ r300_texture_blanket(struct pipe_screen* screen,
+ const struct pipe_texture* base,
+ const unsigned* stride,
+ struct pipe_buffer* buffer)
+{
+ struct r300_texture* tex;
+
+ if (base->target != PIPE_TEXTURE_2D ||
+ base->last_level != 0 ||
+ base->depth[0] != 1) {
+ return NULL;
+ }
+
+ tex = CALLOC_STRUCT(r300_texture);
+ if (!tex) {
+ return NULL;
+ }
+
+ tex->tex = *base;
+ tex->tex.refcount = 1;
+ tex->tex.screen = screen;
+
+ /* XXX tex->stride = *stride; */
+
+ pipe_buffer_reference(screen, &tex->buffer, buffer);
+
+ return (struct pipe_texture*)tex;
+}
+
void r300_init_screen_texture_functions(struct pipe_screen* screen)
{
screen->texture_create = r300_texture_create;
screen->texture_release = r300_texture_release;
screen->get_tex_surface = r300_get_tex_surface;
screen->tex_surface_release = r300_tex_surface_release;
+ screen->texture_blanket = r300_texture_blanket;
}