Mesa (master): r300g: abort if a vertex buffer offset is not dword-aligned

Marek Olšák mareko at kemper.freedesktop.org
Mon Apr 26 05:22:50 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Mar 22 02:18:51 2010 +0100

r300g: abort if a vertex buffer offset is not dword-aligned

---

 src/gallium/drivers/r300/r300_emit.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 19acdab..7dc7c1d 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -832,6 +832,15 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset)
     unsigned packet_size = (aos_count * 3 + 1) / 2;
     CS_LOCALS(r300);
 
+    for (i = 0; i < aos_count; i++) {
+        if ((vbuf[velem[i].vertex_buffer_index].buffer_offset + velem[i].src_offset) % 4 != 0) {
+            /* XXX We must align the buffer. */
+            assert(0);
+            fprintf(stderr, "r300: Unaligned vertex buffer offsets aren't supported, aborting..\n");
+            abort();
+        }
+    }
+
     BEGIN_CS(2 + packet_size + aos_count * 2);
     OUT_CS_PKT3(R300_PACKET3_3D_LOAD_VBPNTR, packet_size);
     OUT_CS(aos_count);




More information about the mesa-commit mailing list