gallium: Add texture usage flags, special-case allocation of display targets
[mesa.git] / src / gallium / drivers / softpipe / sp_context.c
index 200fb415acfd41b00467100b16e0ca7a417ee171..2af0db37143752f521c5b6cdeb3457707e30aa0e 100644 (file)
@@ -122,12 +122,12 @@ static void softpipe_destroy( struct pipe_context *pipe )
 struct pipe_context *
 softpipe_create( struct pipe_screen *screen,
                  struct pipe_winsys *pipe_winsys,
-                 struct softpipe_winsys *softpipe_winsys )
+                 void *unused )
 {
    struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
    uint i;
 
-#if defined(__i386__) || defined(__386__)
+#ifdef PIPE_ARCH_X86
    softpipe->use_sse = GETENV( "GALLIUM_NOSSE" ) == NULL;
 #else
    softpipe->use_sse = FALSE;
@@ -178,6 +178,8 @@ softpipe_create( struct pipe_screen *screen,
 
    softpipe->pipe.draw_arrays = softpipe_draw_arrays;
    softpipe->pipe.draw_elements = softpipe_draw_elements;
+   softpipe->pipe.set_edgeflags = softpipe_set_edgeflags;
+
 
    softpipe->pipe.clear = softpipe_clear;
    softpipe->pipe.flush = softpipe_flush;
@@ -190,11 +192,11 @@ softpipe_create( struct pipe_screen *screen,
     * Must be before quad stage setup!
     */
    for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++)
-      softpipe->cbuf_cache[i] = sp_create_tile_cache();
-   softpipe->zsbuf_cache = sp_create_tile_cache();
+      softpipe->cbuf_cache[i] = sp_create_tile_cache( screen );
+   softpipe->zsbuf_cache = sp_create_tile_cache( screen );
 
    for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
-      softpipe->tex_cache[i] = sp_create_tile_cache();
+      softpipe->tex_cache[i] = sp_create_tile_cache( screen );
 
 
    /* setup quad rendering stages */
@@ -210,8 +212,6 @@ softpipe_create( struct pipe_screen *screen,
    softpipe->quad.colormask = sp_quad_colormask_stage(softpipe);
    softpipe->quad.output = sp_quad_output_stage(softpipe);
 
-   softpipe->winsys = softpipe_winsys;
-
    /*
     * Create drawing context and plug our rendering stage into it.
     */