draw: remove dead data structures
authorKeith Whitwell <keith@tungstengraphics.com>
Fri, 18 Apr 2008 23:27:12 +0000 (00:27 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Fri, 18 Apr 2008 23:27:12 +0000 (00:27 +0100)
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_private.h

index 9c3ae9bc0d92e87a9ed3798c435fb9ebf28bf84e..6012bc155ef5d5a79b7f0aa03f1d6d926abc5283 100644 (file)
@@ -83,16 +83,6 @@ struct draw_context *draw_create( void )
    ASSIGN_4V( draw->plane[5],  0,  0, -1, 1 ); /* mesa's a bit wonky */
    draw->nr_planes = 6;
 
-   /* Statically allocate maximum sized vertices for the cache - could be cleverer...
-    */
-   {
-      char *tmp = align_malloc(VS_QUEUE_LENGTH * MAX_VERTEX_ALLOCATION, 16);
-      if (!tmp)
-         goto fail;
-
-      draw->vs.vertex_cache = tmp;
-   }
-
    /* these defaults are oriented toward the needs of softpipe */
    draw->wide_point_threshold = 1000000.0; /* infinity */
    draw->wide_line_threshold = 1.0;
@@ -162,10 +152,6 @@ void draw_destroy( struct draw_context *draw )
       align_free(draw->machine.Outputs);
    tgsi_exec_machine_free_data(&draw->machine);
 
-
-   if (draw->vs.vertex_cache)
-      align_free( draw->vs.vertex_cache ); /* Frees all the vertices. */
-
    /* Not so fast -- we're just borrowing this at the moment.
     * 
    if (draw->render)
@@ -254,8 +240,6 @@ draw_set_vertex_buffers(struct draw_context *draw,
 {
    assert(count <= PIPE_MAX_ATTRIBS);
 
-   draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
-
    memcpy(draw->vertex_buffer, buffers, count * sizeof(buffers[0]));
    draw->nr_vertex_buffers = count;
 }
@@ -268,8 +252,6 @@ draw_set_vertex_elements(struct draw_context *draw,
 {
    assert(count <= PIPE_MAX_ATTRIBS);
 
-   draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
-
    memcpy(draw->vertex_element, elements, count * sizeof(elements[0]));
    draw->nr_vertex_elements = count;
 }
@@ -282,7 +264,6 @@ void
 draw_set_mapped_vertex_buffer(struct draw_context *draw,
                               unsigned attr, const void *buffer)
 {
-   draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
    draw->user.vbuffer[attr] = buffer;
 }
 
@@ -291,7 +272,6 @@ void
 draw_set_mapped_constant_buffer(struct draw_context *draw,
                                 const void *buffer)
 {
-   draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
    draw->user.constants = buffer;
 }
 
index 93add257a379c57bfd009e3109d02cc7480ed8c2..78265c64a66f41668e63c0e6b87e7a6470602c3b 100644 (file)
@@ -195,9 +195,6 @@ struct draw_context
    /* Support prototype passthrough path:
     */
    struct {
-      unsigned prim;           /* XXX: to be removed */
-      unsigned hw_vertex_size; /* XXX: to be removed */
-
       struct {
          struct draw_pt_middle_end *opt[PT_MAX_MIDDLE];
       } middle;
@@ -272,54 +269,6 @@ struct draw_context
    /** TGSI program interpreter runtime state */
    struct tgsi_exec_machine machine;
 
-   /* Vertex fetch internal state
-    */
-   struct {
-      const ubyte *src_ptr[PIPE_MAX_ATTRIBS];
-      unsigned pitch[PIPE_MAX_ATTRIBS];
-      fetch_func fetch[PIPE_MAX_ATTRIBS];
-      unsigned nr_attrs;
-      full_fetch_func fetch_func;
-      pt_fetch_func pt_fetch;
-   } vertex_fetch;
-
-   /* Post-tnl vertex cache:
-    */
-   struct {
-      unsigned referenced;  /**< bitfield */
-
-      struct {
-        unsigned in;           /* client array element */
-        unsigned out;          /* index in vs queue/array */
-      } idx[VCACHE_SIZE + VCACHE_OVERFLOW];
-
-      unsigned overflow;
-
-      /** To find space in the vertex cache: */
-      struct vertex_header *(*get_vertex)( struct draw_context *draw,
-                                           unsigned i );
-   } vcache;
-
-   /* Vertex shader queue:
-    */
-   struct {
-      unsigned elts[VS_QUEUE_LENGTH];   /**< index into the user's vertex arrays */
-      char *vertex_cache;
-      unsigned queue_nr;
-      unsigned post_nr;
-   } vs;
-
-   /* Prim pipeline queue:
-    */
-   struct {
-      /* Need to queue up primitives until their vertices have been
-       * transformed by a vs queue flush.
-       */
-      struct prim_header queue[PRIM_QUEUE_LENGTH];
-      unsigned queue_nr;
-   } pq;
-
-
    /* This (and the tgsi_exec_machine struct) probably need to be moved somewhere private.
     */
    struct gallivm_cpu_engine *engine;   
@@ -372,9 +321,6 @@ boolean draw_pt_arrays( struct draw_context *draw,
 
 void draw_pt_reset_vertex_ids( struct draw_context *draw );
 
-#define DRAW_FLUSH_SHADER_QUEUE              0x1 /* sized not to overflow, never raised */
-#define DRAW_FLUSH_PRIM_QUEUE                0x2
-#define DRAW_FLUSH_VERTEX_CACHE              0x4
 #define DRAW_FLUSH_STATE_CHANGE              0x8
 #define DRAW_FLUSH_BACKEND                   0x10
 
@@ -416,10 +362,5 @@ dot4(const float *a, const float *b)
    return result;
 }
 
-static INLINE struct vertex_header *
-draw_header_from_block(char *block, int size, int num)
-{
-   return (struct vertex_header*)(block + num * size);
-}
 
 #endif /* DRAW_PRIVATE_H */