r300c: Fix vertex data setup for named buffer objects with unaligned offset
authorMaciej Cencora <m.cencora@gmail.com>
Sun, 11 Jul 2010 12:04:18 +0000 (14:04 +0200)
committerMaciej Cencora <m.cencora@gmail.com>
Sun, 11 Jul 2010 12:25:35 +0000 (14:25 +0200)
Candidate for 7.8 branch

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
src/mesa/drivers/dri/r300/r300_draw.c

index 282c0e18bca490045b8473bbb62dcff14639c1da..5ae9f49840b64eb86183e6d4f337f355c6bda03d 100644 (file)
@@ -523,8 +523,7 @@ static void r300AllocDmaRegions(GLcontext *ctx, const struct gl_client_array *in
                        r300ConvertAttrib(ctx, count, input[i], &vbuf->attribs[index]);
                } else {
                        if (input[i]->BufferObj->Name) {
-                               if (stride % 4 != 0) {
-                                       assert(((intptr_t) input[i]->Ptr) % input[i]->StrideB == 0);
+                               if (stride % 4 != 0 || (intptr_t)input[i]->Ptr % 4 != 0) {
                                        r300AlignDataToDword(ctx, input[i], count, &vbuf->attribs[index]);
                                        vbuf->attribs[index].is_named_bo = GL_FALSE;
                                } else {