Checkpoint: remove more of the old draw_vb() code.
authorBrian <brian.paul@tungstengraphics.com>
Mon, 20 Aug 2007 22:31:12 +0000 (16:31 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 20 Aug 2007 22:31:12 +0000 (16:31 -0600)
src/mesa/pipe/draw/draw_arrays.c
src/mesa/pipe/draw/draw_context.c
src/mesa/pipe/draw/draw_private.h
src/mesa/pipe/i915simple/i915_context.c
src/mesa/pipe/p_context.h
src/mesa/pipe/softpipe/sp_context.c
src/mesa/pipe/softpipe/sp_state_vertex.c
src/mesa/state_tracker/st_draw.c

index fe9ec444252c694344b5fdd51cdc7bf0d29a5528..8cb34e8f8ed9163ac8d9d0404ab9757275408f88 100644 (file)
@@ -354,9 +354,6 @@ do {                                                                \
 } while (0)
 
 
-/**
- * XXX very similar to same func in draw_vb.c (which will go away)
- */
 void
 draw_set_vertex_attributes( struct draw_context *draw,
                             const unsigned *slot_to_vf_attr,
index cc00576c53b22dd7520bbc684cd556cbcfd808ae..0a3df37b7fab675224a44741975ded5656cbf958 100644 (file)
@@ -60,7 +60,9 @@ struct draw_context *draw_create( void )
    draw->nr_planes = 6;
 
 #ifdef MESA
+#if 0
    draw->vf = vf_create( GL_TRUE );
+#endif
 #endif
 
    /* Statically allocate maximum sized vertices for the cache - could be cleverer...
@@ -79,7 +81,7 @@ struct draw_context *draw_create( void )
 
 void draw_destroy( struct draw_context *draw )
 {
-#ifdef MESA
+#if 0/*def MESA*/
    if (draw->header.storage) {
       ALIGN_FREE( draw->header.storage );
    }
@@ -194,7 +196,9 @@ void draw_set_viewport_state( struct draw_context *draw,
    draw->viewport = *viewport; /* struct copy */
 
 #ifdef MESA
+#if 0
    vf_set_vp_scale_translate( draw->vf, viewport->scale, viewport->translate );
+#endif
 #endif
 
    /* Using tnl/ and vf/ modules is temporary while getting started.
index 5c3efb80e992368fb0f36f9e99a29cd287eb6908..a9825e646b1111e512f6a0713f3faee656c2fd94 100644 (file)
@@ -222,14 +222,11 @@ struct draw_context
    } pq;
 
 
-   /* Misc for draw_vb.c (XXX temporary)
-    */
-#ifdef MESA
-   GLvector4f header;
-#endif
+#if 0
    ubyte *verts;
    boolean in_vb;
    struct vertex_fetch *vf;
+#endif
 };
 
 
index c7d469583c7922beccb43dbb7d4576bb18667b95..b34899a86712002c3b8e08ee0ee63617a2837ccb 100644 (file)
@@ -147,33 +147,16 @@ static void i915_destroy( struct pipe_context *pipe )
    free( i915 );
 }
 
-static void i915_draw_vb( struct pipe_context *pipe,
-                            struct vertex_buffer *VB )
-{
-   struct i915_context *i915 = i915_context( pipe );
-
-   if (i915->dirty)
-      i915_update_derived( i915 );
-
-#if 0
-   draw_vb( i915->draw, VB );
-#endif
-}
 
-
-static void
-i915_draw_vertices(struct pipe_context *pipe,
-                       unsigned mode,
-                       unsigned numVertex, const float *verts,
-                       unsigned numAttribs, const unsigned attribs[])
+static void i915_draw_arrays( struct pipe_context *pipe,
+                              unsigned mode, unsigned start, unsigned count)
 {
    struct i915_context *i915 = i915_context( pipe );
 
    if (i915->dirty)
       i915_update_derived( i915 );
-#if 0
-   draw_vertices(i915->draw, mode, numVertex, verts, numAttribs, attribs);
-#endif
+
+   draw_arrays(i915->draw, mode, start, count);
 }
 
 
@@ -217,12 +200,11 @@ struct pipe_context *i915_create( struct pipe_winsys *pipe_winsys,
    i915->pipe.destroy = i915_destroy;
    i915->pipe.supported_formats = i915_supported_formats;
    i915->pipe.max_texture_size = i915_max_texture_size;
-   i915->pipe.draw_vb = i915_draw_vb;
-   i915->pipe.draw_vertices = i915_draw_vertices;
    i915->pipe.clear = i915_clear;
    i915->pipe.reset_occlusion_counter = NULL; /* no support */
    i915->pipe.get_occlusion_counter = NULL;
 
+   i915->pipe.draw_arrays = i915_draw_arrays;
 
    /*
     * Create drawing context and plug our rendering stage into it.
index a3664a3b80c0b155e05f646be4d05409c21fe5d0..c4496cda50797ea229f018af0b7451c4e77e0fa7 100644 (file)
 #ifndef PIPE_CONTEXT_H
 #define PIPE_CONTEXT_H
 
-//#include "main/mtypes.h"
 #include "p_state.h"
 #include "p_compiler.h"
 
 
-/* Drawing currently kludged up via the existing tnl/ module.  
- */
-struct vertex_buffer;
-
-
 /**
  * Software pipeline rendering context.  Basically a collection of
  * state setting functions, plus VBO drawing entrypoint.
@@ -68,17 +62,6 @@ struct pipe_context {
    /*
     * Drawing
     */
-   /* XXX this is temporary */
-   void (*draw_vb)( struct pipe_context *pipe,
-                   struct vertex_buffer *VB );
-
-   /* XXX this is temporary */
-   void (*draw_vertices)( struct pipe_context *pipe,
-                          unsigned mode,
-                          unsigned numVertex, const float *verts,
-                          unsigned numAttribs, const unsigned attribs[]);
-
-   /** this is basically what we want */
    void (*draw_arrays)( struct pipe_context *pipe,
                         unsigned mode, unsigned start, unsigned count);
 
index 91ede05c05a7f3d71d20e4fa0a4d2fd20e443209..ab9becc99e2f51063a31654d4be764cef00a6ce8 100644 (file)
@@ -195,44 +195,6 @@ static void softpipe_destroy( struct pipe_context *pipe )
 }
 
 
-#if 0
-static void softpipe_draw_vb( struct pipe_context *pipe,
-                            struct vertex_buffer *VB )
-{
-   struct softpipe_context *softpipe = softpipe_context( pipe );
-
-   if (softpipe->dirty)
-      softpipe_update_derived( softpipe );
-
-   /* XXX move mapping/unmapping to higher/coarser level? */
-   softpipe_map_surfaces(softpipe);
-   draw_vb( softpipe->draw, VB );
-   softpipe_unmap_surfaces(softpipe);
-}
-#endif
-
-
-static void
-softpipe_draw_vertices(struct pipe_context *pipe,
-                       unsigned mode,
-                       unsigned numVertex, const float *verts,
-                       unsigned numAttribs, const unsigned attribs[])
-{
-   struct softpipe_context *softpipe = softpipe_context( pipe );
-
-   if (softpipe->dirty)
-      softpipe_update_derived( softpipe );
-
-   /* XXX move mapping/unmapping to higher/coarser level? */
-   softpipe_map_surfaces(softpipe);
-#if 0
-   draw_vertices(softpipe->draw, mode, numVertex, verts, numAttribs, attribs);
-#endif
-   softpipe_unmap_surfaces(softpipe);
-}
-
-
-
 static void softpipe_reset_occlusion_counter(struct pipe_context *pipe)
 {
    struct softpipe_context *softpipe = softpipe_context( pipe );
@@ -289,10 +251,6 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
    softpipe->pipe.set_vertex_buffer = softpipe_set_vertex_buffer;
    softpipe->pipe.set_vertex_element = softpipe_set_vertex_element;
 
-#if 0
-   softpipe->pipe.draw_vb = softpipe_draw_vb;
-   softpipe->pipe.draw_vertices = softpipe_draw_vertices;
-#endif
    softpipe->pipe.draw_arrays = softpipe_draw_arrays;
    softpipe->pipe.draw_elements = softpipe_draw_elements;
 
index 18852552eb339aadf54087fe3805e625ffc68cdb..09ff540ccfdd76a026e25346391b1c27c43b137d 100644 (file)
 
 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
  */
+
+
 #include "sp_context.h"
 #include "sp_state.h"
 #include "sp_surface.h"
 
+#include "pipe/draw/draw_context.h"
+
 
 void
 softpipe_set_vertex_element(struct pipe_context *pipe,
index a409dd976487ab26fb3b7bac2db7d199d5b1820a..5a13fdd2bf738321ca5df8cc4ea9e8ca067d3299 100644 (file)
 #include "main/imports.h"
 
 #include "vbo/vbo.h"
+#include "vbo/vbo_context.h"
 
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "tnl/t_vp_build.h"  /* USE_NEW_DRAW */
+#include "tnl/t_vp_build.h"
 
 #include "st_context.h"
 #include "st_atom.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_winsys.h"
 
-#include "vbo/vbo_context.h"
-
-/*
- * Enabling this causes the VBO module to call draw_vbo() below,
- * bypassing the T&L module.  This only works with VBO-based demos,
- * such as progs/test/bufferobj.c
- */
-#define USE_NEW_DRAW 01
-
-
-/*
- * TNL stage which feeds into the above.
- *
- * XXX: this needs to go into each driver using this code, because we
- * cannot make the leap from ctx->draw_context in this file.  The
- * driver needs to customize tnl anyway, so this isn't a big deal.
- */
-static GLboolean draw( GLcontext * ctx, struct tnl_pipeline_stage *stage )
-{
-   struct st_context *st = st_context(ctx);
-#if 0
-   struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-#endif
-
-   /* Validate driver and pipe state:
-    */
-   st_validate_state( st );
-
-   /* Call into the new draw code to handle the VB:
-    */
-#if 0
-   st->pipe->draw_vb( st->pipe, VB );
-#endif
-
-   /* Finished 
-    */
-   return GL_FALSE;
-}
-
-const struct tnl_pipeline_stage st_draw = {
-   "check state and draw",
-   NULL,
-   NULL,
-   NULL,
-   NULL,
-   draw
-};
-
-static const struct tnl_pipeline_stage *st_pipeline[] = {
-#if USE_NEW_DRAW
-   &_tnl_vertex_program_stage,
-#else
-   &_tnl_vertex_transform_stage,
-   &_tnl_vertex_cull_stage,
-   &_tnl_normal_transform_stage,
-   &_tnl_lighting_stage,
-   &_tnl_fog_coordinate_stage,
-   &_tnl_texgen_stage,
-   &_tnl_texture_transform_stage,
-   &_tnl_point_attenuation_stage,
-   &_tnl_vertex_program_stage,
-#endif
-   &st_draw,     /* ADD: escape to pipe */
-   0,
-};
-
 
 
 static GLuint
@@ -366,8 +299,6 @@ st_draw_vertices(GLcontext *ctx, unsigned prim,
 void st_init_draw( struct st_context *st )
 {
    GLcontext *ctx = st->ctx;
-
-#if USE_NEW_DRAW
    struct vbo_context *vbo = (struct vbo_context *) ctx->swtnl_im;
 
    create_default_attribs_buffer(st);
@@ -376,13 +307,6 @@ void st_init_draw( struct st_context *st )
    assert(vbo->draw_prims);
    vbo->draw_prims = draw_vbo;
 
-#endif
-#if 0
-   _tnl_destroy_pipeline( ctx );
-   _tnl_install_pipeline( ctx, st_pipeline );
-#endif
-
-   /* USE_NEW_DRAW */
    _tnl_ProgramCacheInit( ctx );
 }