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

index 03d35fb3cb59e4a4cef97d4bbf651020ffd5e313,b3ece9d8ed3bcbf8d92ed5a915a507936602457e..2a27e5ce64d6b403c571cc9731ab377ea823877a
@@@ -98,26 -98,133 +98,133 @@@ 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 min_index,
                               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);
+ {
 -boolean
++   softpipe_draw_range_elements_instanced(pipe,
++                                          indexBuffer,
++                                          indexSize,
++                                          min_index,
++                                          max_index,
++                                          mode,
++                                          start,
++                                          count,
++                                          0,
++                                          1);
+ }
 -   return softpipe_draw_range_elements_instanced(pipe,
 -                                                 indexBuffer,
 -                                                 indexSize,
 -                                                 0,
 -                                                 0xffffffff,
 -                                                 mode,
 -                                                 start,
 -                                                 count,
 -                                                 0,
 -                                                 1);
++void
+ softpipe_draw_elements(struct pipe_context *pipe,
+                        struct pipe_buffer *indexBuffer,
+                        unsigned indexSize,
+                        unsigned mode, unsigned start, unsigned count)
+ {
 -static boolean
++   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 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;
     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 );
- }
index d2f8085b42123c3a0327e281fe28460b58298c9b,f2242d206947c5f78e8df20f774dec81963ffac1..497b35a6807edc605a094d4d8fdc1aba99f289ff
@@@ -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