Merge branch 'instanced-arrays'
authorMichal Krol <michal@vmware.com>
Thu, 14 Jan 2010 17:11:41 +0000 (18:11 +0100)
committerMichal Krol <michal@vmware.com>
Thu, 14 Jan 2010 17:11:41 +0000 (18:11 +0100)
Conflicts:
src/gallium/drivers/softpipe/sp_draw_arrays.c

1  2 
src/gallium/drivers/softpipe/sp_draw_arrays.c
src/gallium/drivers/softpipe/sp_state.h
src/gallium/drivers/svga/svga_state_vs.c
src/gallium/include/pipe/p_context.h
src/gallium/include/pipe/p_state.h

@@@ -98,20 -98,42 +98,42 @@@ softpipe_unmap_constant_buffers(struct 
  }
  
  
 -static boolean
+ /**
+  * Draw vertex arrays, with optional indexing.
+  * Basically, map the vertex buffers (and drawing surfaces), then hand off
+  * the drawing to the 'draw' module.
+  */
 -boolean
++static void
+ softpipe_draw_range_elements_instanced(struct pipe_context *pipe,
+                                        struct pipe_buffer *indexBuffer,
+                                        unsigned indexSize,
+                                        unsigned minIndex,
+                                        unsigned maxIndex,
+                                        unsigned mode,
+                                        unsigned start,
+                                        unsigned count,
+                                        unsigned startInstance,
+                                        unsigned instanceCount);
 +void
  softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
                       unsigned start, unsigned count)
  {
-    softpipe_draw_elements(pipe, NULL, 0, mode, start, count);
 -   return softpipe_draw_range_elements_instanced(pipe,
 -                                                 NULL,
 -                                                 0,
 -                                                 0,
 -                                                 0xffffffff,
 -                                                 mode,
 -                                                 start,
 -                                                 count,
 -                                                 0,
 -                                                 1);
++   softpipe_draw_range_elements_instanced(pipe,
++                                          NULL,
++                                          0,
++                                          0,
++                                          0xffffffff,
++                                          mode,
++                                          start,
++                                          count,
++                                          0,
++                                          1);
  }
  
  
- /**
-  * Draw vertex arrays, with optional indexing.
-  * Basically, map the vertex buffers (and drawing surfaces), then hand off
-  * the drawing to the 'draw' module.
-  */
 -boolean
 +void
  softpipe_draw_range_elements(struct pipe_context *pipe,
                               struct pipe_buffer *indexBuffer,
                               unsigned indexSize,
                               unsigned max_index,
                               unsigned mode, unsigned start, unsigned count)
  {
 -   return softpipe_draw_range_elements_instanced(pipe,
 -                                                 indexBuffer,
 -                                                 indexSize,
 -                                                 min_index,
 -                                                 max_index,
 -                                                 mode,
 -                                                 start,
 -                                                 count,
 -                                                 0,
 -                                                 1);
++   softpipe_draw_range_elements_instanced(pipe,
++                                          indexBuffer,
++                                          indexSize,
++                                          min_index,
++                                          max_index,
++                                          mode,
++                                          start,
++                                          count,
++                                          0,
++                                          1);
+ }
 -boolean
++void
+ softpipe_draw_elements(struct pipe_context *pipe,
+                        struct pipe_buffer *indexBuffer,
+                        unsigned indexSize,
+                        unsigned mode, unsigned start, unsigned count)
+ {
 -   return softpipe_draw_range_elements_instanced(pipe,
 -                                                 indexBuffer,
 -                                                 indexSize,
 -                                                 0,
 -                                                 0xffffffff,
 -                                                 mode,
 -                                                 start,
 -                                                 count,
 -                                                 0,
 -                                                 1);
++   softpipe_draw_range_elements_instanced(pipe,
++                                          indexBuffer,
++                                          indexSize,
++                                          0,
++                                          0xffffffff,
++                                          mode,
++                                          start,
++                                          count,
++                                          0,
++                                          1);
+ }
+ void
+ softpipe_draw_arrays_instanced(struct pipe_context *pipe,
+                                unsigned mode,
+                                unsigned start,
+                                unsigned count,
+                                unsigned startInstance,
+                                unsigned instanceCount)
+ {
+    softpipe_draw_range_elements_instanced(pipe,
+                                           NULL,
+                                           0,
+                                           0,
+                                           0xffffffff,
+                                           mode,
+                                           start,
+                                           count,
+                                           startInstance,
+                                           instanceCount);
+ }
+ void
+ softpipe_draw_elements_instanced(struct pipe_context *pipe,
+                                  struct pipe_buffer *indexBuffer,
+                                  unsigned indexSize,
+                                  unsigned mode,
+                                  unsigned start,
+                                  unsigned count,
+                                  unsigned startInstance,
+                                  unsigned instanceCount)
+ {
+    softpipe_draw_range_elements_instanced(pipe,
+                                           indexBuffer,
+                                           indexSize,
+                                           0,
+                                           0xffffffff,
+                                           mode,
+                                           start,
+                                           count,
+                                           startInstance,
+                                           instanceCount);
+ }
 -static boolean
++static void
+ softpipe_draw_range_elements_instanced(struct pipe_context *pipe,
+                                        struct pipe_buffer *indexBuffer,
+                                        unsigned indexSize,
+                                        unsigned minIndex,
+                                        unsigned maxIndex,
+                                        unsigned mode,
+                                        unsigned start,
+                                        unsigned count,
+                                        unsigned startInstance,
+                                        unsigned instanceCount)
+ {
     struct softpipe_context *sp = softpipe_context(pipe);
     struct draw_context *draw = sp->draw;
     unsigned i;
     softpipe_unmap_constant_buffers(sp);
  
     sp->dirty_render_cache = TRUE;
 -
 -   return TRUE;
  }
- void
- softpipe_draw_elements(struct pipe_context *pipe,
-                        struct pipe_buffer *indexBuffer,
-                        unsigned indexSize,
-                        unsigned mode, unsigned start, unsigned count)
- {
-    softpipe_draw_range_elements( pipe, indexBuffer,
-                                  indexSize,
-                                  0, 0xffffffff,
-                                  mode, start, count );
- }
@@@ -61,14 -61,30 +61,30 @@@ struct pipe_context 
      * VBO drawing (return false on fallbacks (temporary??))
      */
     /*@{*/
 -   boolean (*draw_arrays)( struct pipe_context *pipe,
 -                         unsigned mode, unsigned start, unsigned count);
 +   void (*draw_arrays)( struct pipe_context *pipe,
 +                        unsigned mode, unsigned start, unsigned count);
  
 -   boolean (*draw_elements)( struct pipe_context *pipe,
 -                           struct pipe_buffer *indexBuffer,
 -                           unsigned indexSize,
 -                           unsigned mode, unsigned start, unsigned count);
 +   void (*draw_elements)( struct pipe_context *pipe,
 +                          struct pipe_buffer *indexBuffer,
 +                          unsigned indexSize,
 +                          unsigned mode, unsigned start, unsigned count);
  
+    void (*draw_arrays_instanced)(struct pipe_context *pipe,
+                                  unsigned mode,
+                                  unsigned start,
+                                  unsigned count,
+                                  unsigned startInstance,
+                                  unsigned instanceCount);
+    void (*draw_elements_instanced)(struct pipe_context *pipe,
+                                    struct pipe_buffer *indexBuffer,
+                                    unsigned indexSize,
+                                    unsigned mode,
+                                    unsigned start,
+                                    unsigned count,
+                                    unsigned startInstance,
+                                    unsigned instanceCount);
     /* XXX: this is (probably) a temporary entrypoint, as the range
      * information should be available from the vertex_buffer state.
      * Using this to quickly evaluate a specialized path in the draw
Simple merge