Mesa (master): i965: disable bounds checking on arrays with stride 0

Roland Scheidegger sroland at kemper.freedesktop.org
Sat Aug 15 01:44:57 UTC 2009


Module: Mesa
Branch: master
Commit: b9789948e0b5c5fad7952ea5b731c675d50a4f58
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b9789948e0b5c5fad7952ea5b731c675d50a4f58

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Sat Aug 15 03:44:02 2009 +0200

i965: disable bounds checking on arrays with stride 0

if stride is 0 we cannot use count as max index for bounds checking,
since the hardware will simply return 0 as data for indices failing
bounds check. If stride is 0 any index should be valid hence simply
disable bounds checking in this case.
This fixes bugs introduced with e643bc5fc7afb563028f5a089ca5e38172af41a8.

---

 src/mesa/drivers/dri/i965/brw_draw_upload.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index ab6b628..d49fb0f 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -547,7 +547,7 @@ static void brw_emit_vertices(struct brw_context *brw)
                         input->offset + input->element_size);
           }
       } else
-          OUT_BATCH(input->count);
+          OUT_BATCH(input->stride ? input->count : 0);
       OUT_BATCH(0); /* Instance data step rate */
    }
    ADVANCE_BATCH();




More information about the mesa-commit mailing list