OSDN Git Service

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 fe9ec44..8cb34e8 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 cc00576..0a3df37 100644 (file)
@@ -60,8 +60,10 @@ 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,8 +196,10 @@ 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.
     * Full pipe will have vertex shader, vertex fetch of its own.
index 5c3efb8..a9825e6 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 c7d4695..b34899a 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 a3664a3..c4496cd 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 91ede05..ab9becc 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 1885255..09ff540 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 a409dd9..5a13fdd 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 );
 }