i965: Fix the bounds emitted in the vertex buffer packets.
authorEric Anholt <eric@anholt.net>
Sun, 11 Oct 2009 18:04:09 +0000 (11:04 -0700)
committerEric Anholt <eric@anholt.net>
Sun, 11 Oct 2009 18:21:03 +0000 (11:21 -0700)
It's the address of the last valid byte, not the address of the first
invalid byte.

This should also fix problems with rendering with the new sanity checks in
the kernel.

src/mesa/drivers/dri/i965/brw_draw_upload.c

index 4aa17fa02d7c7bd7631a72ede997d814d92c32d0..5c33246749897ab6c087a987ed1fb78d892738e1 100644 (file)
@@ -539,12 +539,12 @@ static void brw_emit_vertices(struct brw_context *brw)
           if (input->stride) {
               OUT_RELOC(input->bo,
                         I915_GEM_DOMAIN_VERTEX, 0,
-                        input->offset + input->stride * input->count);
+                        input->offset + input->stride * input->count - 1);
           } else {
               assert(input->count == 1);
               OUT_RELOC(input->bo,
                         I915_GEM_DOMAIN_VERTEX, 0,
-                        input->offset + input->element_size);
+                        input->offset + input->element_size - 1);
           }
       } else
           OUT_BATCH(input->stride ? input->count : 0);