Mesa (gallium-index-bias): draw: No need to rebase for elt_bias.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Apr 20 09:06:55 UTC 2010


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Apr 20 11:06:05 2010 +0200

draw: No need to rebase for elt_bias.

As we are rebasing to min_index + elt_bias, and the vertex buffer has no
elt_bias.

I still don't know how to exercise this code. I hope this is now right.

---

 src/gallium/auxiliary/draw/draw_pt_vcache.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pt_vcache.c b/src/gallium/auxiliary/draw/draw_pt_vcache.c
index 28dc514..37ffbac 100644
--- a/src/gallium/auxiliary/draw/draw_pt_vcache.c
+++ b/src/gallium/auxiliary/draw/draw_pt_vcache.c
@@ -366,8 +366,7 @@ vcache_check_run( struct draw_pt_front_end *frontend,
    assert((elt_bias >= 0 && min_index + elt_bias >= min_index) ||
           (elt_bias <  0 && min_index + elt_bias <  min_index));
 
-   if (elt_bias <= 0 &&
-       min_index == (unsigned)-elt_bias &&
+   if (min_index == 0 &&
        index_size == 2)
    {
       transformed_elts = (const ushort *)elts;
@@ -378,8 +377,7 @@ vcache_check_run( struct draw_pt_front_end *frontend,
       if (!storage)
          goto fail;
       
-      if (elt_bias <= 0 &&
-          min_index == (unsigned)-elt_bias) {
+      if (min_index == 0) {
          switch(index_size) {
          case 1:
             translate_ubyte_elts( (const ubyte *)elts,
@@ -410,21 +408,21 @@ vcache_check_run( struct draw_pt_front_end *frontend,
          case 1:
             rebase_ubyte_elts( (const ubyte *)elts,
                                   draw_count,
-                                  -elt_bias - (int)min_index,
+                                  0 - (int)min_index,
                                   storage );
             break;
 
          case 2:
             rebase_ushort_elts( (const ushort *)elts,
                                    draw_count,
-                                   -elt_bias - (int)min_index,
+                                   0 - (int)min_index,
                                    storage );
             break;
 
          case 4:
             rebase_uint_elts( (const uint *)elts,
                                  draw_count,
-                                 -elt_bias - (int)min_index,
+                                 0 - (int)min_index,
                                  storage );
             break;
 




More information about the mesa-commit mailing list