grDrawVertexArrayContiguous fix for Mesa

This commit is contained in:
koolsmoky
2004-05-04 17:08:18 +00:00
parent 8a883aaec9
commit 6f3748e9c4
2 changed files with 7 additions and 5 deletions

View File

@@ -553,8 +553,10 @@ GR_DIENTRY(grDrawVertexArrayContiguous, void , (FxU32 mode, FxU32 Count, void *p
void *b_ptr, *c_ptr;
while ((int)Count >= 3) {
b_ptr = (void *)((FxU32)pointers + stride);
c_ptr = (void *)((FxU32)pointers + stride*2);
TRISETUP(pointers, b_ptr, c_ptr);
c_ptr = (void *)((FxU32)b_ptr + stride);
/*TRISETUP(pointers, b_ptr, c_ptr);*/
/* Do extra context checking. Fixes GLExcess (Spaceship chase) crash with Mesa. */
grDrawTriangle(pointers, b_ptr, c_ptr);
pointers = (void *)((FxU32)c_ptr + stride);
Count -= 3;
}

View File

@@ -355,7 +355,7 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c))
test edx, edx;
je lostContext;
mov eax, [edx + kLostContextOffset];
test eax, eax
test eax, eax;
je lostContext;
mov eax, [eax];
test eax, 1;
@@ -365,13 +365,13 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c))
}
#else
__asm {
mov eax, DWORD PTR fs:[WNT_TEB_PTR] ;
mov eax, DWORD PTR fs:[WNT_TEB_PTR];
add eax, DWORD PTR _GlideRoot.tlsOffset;
mov edx, [eax];
test edx, edx;
je lostContext;
mov eax, [edx + kLostContextOffset];
test eax, eax
test eax, eax;
je lostContext;
mov eax, [eax];
test eax, 1;