r300: Finish basic state setup.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 24 Jan 2009 01:01:04 +0000 (17:01 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 2 Feb 2009 07:30:27 +0000 (23:30 -0800)
I have successfully fooled glxinfo into believing that I am a competent
writer of code. Next step is to trick trivial/clear.

src/gallium/drivers/r300/Makefile
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_texture.c

index f1b1a615b888ac71020df0e2e98eab87549ec098..1f67692166038b2681ca3203aff2a00a50f30fac 100644 (file)
@@ -9,6 +9,7 @@ C_SOURCES = \
        r300_clear.c \
        r300_context.c \
        r300_emit.c \
+       r300_flush.c \
        r300_screen.c \
        r300_state.c \
        r300_surface.c \
index f254b2f2a32619be4170e50d4bfea96ea5b5a541..314b2f0a11be406808a86cfc196bc79da9bab485 100644 (file)
@@ -52,6 +52,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state);
     r300->scissor_state = CALLOC_STRUCT(r300_scissor_state);
 
+    r300_init_flush_functions(r300);
+
     r300_init_surface_functions(r300);
 
     r300_init_state_functions(r300);
index 2b83ae060c2c618234ff28ef83d65baf520a0502..bd5aa4f4664581dca422fbde67d98eebaaa17022 100644 (file)
@@ -117,6 +117,7 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param)
 static boolean check_tex_2d_format(enum pipe_format format)
 {
     switch (format) {
+        case PIPE_FORMAT_A8R8G8B8_UNORM:
         case PIPE_FORMAT_I8_UNORM:
             return TRUE;
         default:
index c1df905033faba349be03337a70d32043bdb84df..4adfe478c3ca1135bfd74083a44cdd6731d4b903 100644 (file)
@@ -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;
 }