Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
[mesa.git] / src / gallium / drivers / softpipe / sp_context.c
index 6a88c277aa63b460450c6c3c7e9917a1673ee42e..edf91ecafa33601dc5d6e9a4c4c86c70843e07de 100644 (file)
 
 
 
-/**
- * Query format support for creating a texture, drawing surface, etc.
- * \param format  the format to test
- * \param type  one of PIPE_TEXTURE, PIPE_SURFACE
- */
-static boolean
-softpipe_is_format_supported( struct pipe_context *pipe,
-                              enum pipe_format format, uint type )
-{
-   switch (type) {
-   case PIPE_TEXTURE:
-      /* softpipe supports all texture formats */
-      return TRUE;
-   case PIPE_SURFACE:
-      /* softpipe supports all (off-screen) surface formats */
-      return TRUE;
-   default:
-      assert(0);
-      return FALSE;
-   }
-}
-
-
 /**
  * Map any drawing surfaces which aren't already mapped
  */
@@ -121,7 +98,6 @@ static void softpipe_destroy( struct pipe_context *pipe )
    softpipe->quad.stencil_test->destroy( softpipe->quad.stencil_test );
    softpipe->quad.occlusion->destroy( softpipe->quad.occlusion );
    softpipe->quad.coverage->destroy( softpipe->quad.coverage );
-   softpipe->quad.bufloop->destroy( softpipe->quad.bufloop );
    softpipe->quad.blend->destroy( softpipe->quad.blend );
    softpipe->quad.colormask->destroy( softpipe->quad.colormask );
    softpipe->quad.output->destroy( softpipe->quad.output );
@@ -151,7 +127,7 @@ softpipe_create( struct pipe_screen *screen,
    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;
@@ -163,16 +139,13 @@ softpipe_create( struct pipe_screen *screen,
    softpipe->pipe.screen = screen;
    softpipe->pipe.destroy = softpipe_destroy;
 
-   /* queries */
-   softpipe->pipe.is_format_supported = softpipe_is_format_supported;
-
    /* state setters */
    softpipe->pipe.create_blend_state = softpipe_create_blend_state;
    softpipe->pipe.bind_blend_state   = softpipe_bind_blend_state;
    softpipe->pipe.delete_blend_state = softpipe_delete_blend_state;
 
    softpipe->pipe.create_sampler_state = softpipe_create_sampler_state;
-   softpipe->pipe.bind_sampler_state   = softpipe_bind_sampler_state;
+   softpipe->pipe.bind_sampler_states  = softpipe_bind_sampler_states;
    softpipe->pipe.delete_sampler_state = softpipe_delete_sampler_state;
 
    softpipe->pipe.create_depth_stencil_alpha_state = softpipe_create_depth_stencil_state;
@@ -197,14 +170,16 @@ softpipe_create( struct pipe_screen *screen,
    softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
    softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
    softpipe->pipe.set_scissor_state = softpipe_set_scissor_state;
-   softpipe->pipe.set_sampler_texture = softpipe_set_sampler_texture;
+   softpipe->pipe.set_sampler_textures = softpipe_set_sampler_textures;
    softpipe->pipe.set_viewport_state = softpipe_set_viewport_state;
 
-   softpipe->pipe.set_vertex_buffer = softpipe_set_vertex_buffer;
-   softpipe->pipe.set_vertex_element = softpipe_set_vertex_element;
+   softpipe->pipe.set_vertex_buffers = softpipe_set_vertex_buffers;
+   softpipe->pipe.set_vertex_elements = softpipe_set_vertex_elements;
 
    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;
@@ -233,7 +208,6 @@ softpipe_create( struct pipe_screen *screen,
    softpipe->quad.stencil_test = sp_quad_stencil_test_stage(softpipe);
    softpipe->quad.occlusion = sp_quad_occlusion_stage(softpipe);
    softpipe->quad.coverage = sp_quad_coverage_stage(softpipe);
-   softpipe->quad.bufloop = sp_quad_bufloop_stage(softpipe);
    softpipe->quad.blend = sp_quad_blend_stage(softpipe);
    softpipe->quad.colormask = sp_quad_colormask_stage(softpipe);
    softpipe->quad.output = sp_quad_output_stage(softpipe);
@@ -247,6 +221,9 @@ softpipe_create( struct pipe_screen *screen,
    assert(softpipe->draw);
    softpipe->setup = sp_draw_render_stage(softpipe);
 
+   if (GETENV( "SP_NO_RAST" ) != NULL)
+      softpipe->no_rast = TRUE;
+
    if (GETENV( "SP_VBUF" ) != NULL) {
       sp_init_vbuf(softpipe);
    }