Mesa (gallium-index-bias): llvmpipe: 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: d27a53d46931d2286c90b21ff7f06f44a7a726bc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d27a53d46931d2286c90b21ff7f06f44a7a726bc

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

llvmpipe: Implement index bias.

---

 src/gallium/drivers/llvmpipe/lp_draw_arrays.c |   12 +++++++-----
 src/gallium/drivers/llvmpipe/lp_state.h       |    4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
index 86525ee..0b63e1c 100644
--- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
+++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
@@ -46,7 +46,7 @@ void
 llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
                      unsigned start, unsigned count)
 {
-   llvmpipe_draw_elements(pipe, NULL, 0, mode, start, count);
+   llvmpipe_draw_elements(pipe, NULL, 0, 0, mode, start, count);
 }
 
 
@@ -59,6 +59,7 @@ void
 llvmpipe_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)
@@ -81,14 +82,14 @@ llvmpipe_draw_range_elements(struct pipe_context *pipe,
    /* Map index buffer, if present */
    if (indexBuffer) {
       void *mapped_indexes = llvmpipe_resource_data(indexBuffer);
-      draw_set_mapped_element_buffer_range(draw, indexSize,
+      draw_set_mapped_element_buffer_range(draw, indexSize, indexBias,
                                            min_index,
                                            max_index,
                                            mapped_indexes);
    }
    else {
       /* no index/element buffer */
-      draw_set_mapped_element_buffer_range(draw, 0, start,
+      draw_set_mapped_element_buffer_range(draw, 0, 0, start,
                                            start + count - 1, NULL);
    }
 
@@ -102,7 +103,7 @@ llvmpipe_draw_range_elements(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);
    }
 
    /*
@@ -118,10 +119,11 @@ void
 llvmpipe_draw_elements(struct pipe_context *pipe,
                        struct pipe_resource *indexBuffer,
                        unsigned indexSize,
+                       int indexBias,
                        unsigned mode, unsigned start, unsigned count)
 {
    llvmpipe_draw_range_elements( pipe, indexBuffer,
-                                 indexSize,
+                                 indexSize, indexBias,
                                  0, 0xffffffff,
                                  mode, start, count );
 }
diff --git a/src/gallium/drivers/llvmpipe/lp_state.h b/src/gallium/drivers/llvmpipe/lp_state.h
index d89c28a..dcbff19 100644
--- a/src/gallium/drivers/llvmpipe/lp_state.h
+++ b/src/gallium/drivers/llvmpipe/lp_state.h
@@ -228,12 +228,12 @@ void llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
 
 void llvmpipe_draw_elements(struct pipe_context *pipe,
 			       struct pipe_resource *indexBuffer,
-			       unsigned indexSize,
+			       unsigned indexSize, int indexBias,
 			       unsigned mode, unsigned start, unsigned count);
 void
 llvmpipe_draw_range_elements(struct pipe_context *pipe,
                              struct pipe_resource *indexBuffer,
-                             unsigned indexSize,
+                             unsigned indexSize, int indexBias,
                              unsigned min_index,
                              unsigned max_index,
                              unsigned mode, unsigned start, unsigned count);




More information about the mesa-commit mailing list