Mesa (gallium-index-bias): softpipe: Implement index bias.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Apr 19 16:22:36 UTC 2010


Module: Mesa
Branch: gallium-index-bias
Commit: 989861fc5ea1792e7ea1be07389db7c3e3b8e383
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=989861fc5ea1792e7ea1be07389db7c3e3b8e383

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Apr 19 18:15:39 2010 +0200

softpipe: Implement index bias.

---

 src/gallium/drivers/softpipe/sp_draw_arrays.c |   16 +++++++++++++---
 src/gallium/drivers/softpipe/sp_state.h       |    4 +++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index 461c9a6..b30036e 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -57,6 +57,7 @@ static void
 softpipe_draw_range_elements_instanced(struct pipe_context *pipe,
                                        struct pipe_resource *indexBuffer,
                                        unsigned indexSize,
+                                       int indexBias,
                                        unsigned minIndex,
                                        unsigned maxIndex,
                                        unsigned mode,
@@ -74,6 +75,7 @@ softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
                                           NULL,
                                           0,
                                           0,
+                                          0,
                                           0xffffffff,
                                           mode,
                                           start,
@@ -87,6 +89,7 @@ void
 softpipe_draw_range_elements(struct pipe_context *pipe,
                              struct pipe_resource *indexBuffer,
                              unsigned indexSize,
+                             int indexBias,
                              unsigned min_index,
                              unsigned max_index,
                              unsigned mode, unsigned start, unsigned count)
@@ -94,6 +97,7 @@ softpipe_draw_range_elements(struct pipe_context *pipe,
    softpipe_draw_range_elements_instanced(pipe,
                                           indexBuffer,
                                           indexSize,
+                                          indexBias,
                                           min_index,
                                           max_index,
                                           mode,
@@ -107,12 +111,13 @@ softpipe_draw_range_elements(struct pipe_context *pipe,
 void
 softpipe_draw_elements(struct pipe_context *pipe,
                        struct pipe_resource *indexBuffer,
-                       unsigned indexSize,
+                       unsigned indexSize, int indexBias,
                        unsigned mode, unsigned start, unsigned count)
 {
    softpipe_draw_range_elements_instanced(pipe,
                                           indexBuffer,
                                           indexSize,
+                                          indexBias,
                                           0,
                                           0xffffffff,
                                           mode,
@@ -134,6 +139,7 @@ softpipe_draw_arrays_instanced(struct pipe_context *pipe,
                                           NULL,
                                           0,
                                           0,
+                                          0,
                                           0xffffffff,
                                           mode,
                                           start,
@@ -146,6 +152,7 @@ void
 softpipe_draw_elements_instanced(struct pipe_context *pipe,
                                  struct pipe_resource *indexBuffer,
                                  unsigned indexSize,
+                                 int indexBias,
                                  unsigned mode,
                                  unsigned start,
                                  unsigned count,
@@ -155,6 +162,7 @@ softpipe_draw_elements_instanced(struct pipe_context *pipe,
    softpipe_draw_range_elements_instanced(pipe,
                                           indexBuffer,
                                           indexSize,
+                                          indexBias,
                                           0,
                                           0xffffffff,
                                           mode,
@@ -168,6 +176,7 @@ static void
 softpipe_draw_range_elements_instanced(struct pipe_context *pipe,
                                        struct pipe_resource *indexBuffer,
                                        unsigned indexSize,
+                                       int indexBias,
                                        unsigned minIndex,
                                        unsigned maxIndex,
                                        unsigned mode,
@@ -202,13 +211,14 @@ softpipe_draw_range_elements_instanced(struct pipe_context *pipe,
       void *mapped_indexes = softpipe_resource(indexBuffer)->data;
       draw_set_mapped_element_buffer_range(draw,
                                            indexSize,
+                                           indexBias,
                                            minIndex,
                                            maxIndex,
                                            mapped_indexes);
    } else {
       /* no index/element buffer */
       draw_set_mapped_element_buffer_range(draw,
-                                           0,
+                                           0, 0,
                                            start,
                                            start + count - 1,
                                            NULL);
@@ -222,7 +232,7 @@ softpipe_draw_range_elements_instanced(struct pipe_context *pipe,
       draw_set_mapped_vertex_buffer(draw, i, NULL);
    }
    if (indexBuffer) {
-      draw_set_mapped_element_buffer(draw, 0, NULL);
+      draw_set_mapped_element_buffer(draw, 0, 0, NULL);
    }
 
    /*
diff --git a/src/gallium/drivers/softpipe/sp_state.h b/src/gallium/drivers/softpipe/sp_state.h
index 3c04c8b..f97fc6e 100644
--- a/src/gallium/drivers/softpipe/sp_state.h
+++ b/src/gallium/drivers/softpipe/sp_state.h
@@ -211,12 +211,13 @@ void softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
 
 void softpipe_draw_elements(struct pipe_context *pipe,
                             struct pipe_resource *indexBuffer,
-                            unsigned indexSize,
+                            unsigned indexSize, int indexBias,
                             unsigned mode, unsigned start, unsigned count);
 void
 softpipe_draw_range_elements(struct pipe_context *pipe,
                              struct pipe_resource *indexBuffer,
                              unsigned indexSize,
+                             int indexBias,
                              unsigned min_index,
                              unsigned max_index,
                              unsigned mode, unsigned start, unsigned count);
@@ -233,6 +234,7 @@ void
 softpipe_draw_elements_instanced(struct pipe_context *pipe,
                                  struct pipe_resource *indexBuffer,
                                  unsigned indexSize,
+                                 int indexBias,
                                  unsigned mode,
                                  unsigned start,
                                  unsigned count,




More information about the mesa-commit mailing list