From: <ma...@co...> - 2005-07-25 02:26:58
|
Hi all, I'm trying to track down a bug/crash that only is appearing under RELEASE builds on Win32. It seems that the release build may be exposing a bug (I don't suspect a bad optimization here... but it could be...) As far as I've been able to trace things, the problem area starts around line 1330 or so in state_transform.c. It's a loop that looks like it's comparing texture matrix stacks, but to be honest, its purpose is a bit beyond me! Could someone who's more familiar with the state tracking mechanisms take a look at that loop and see if there isn't something fishy going on? Thanks, Jon For reference the code from that section is as follows: for (j = 0 ; j < maxTextureUnits; j++) { if (from->textureStack[j].depth > to->textureStack[j].depth) { if (textureFrom->curTextureUnit != j) { diff_api.ActiveTextureARB( j + GL_TEXTURE0_ARB ); textureFrom->curTextureUnit = j; } for (i = to->textureStack[j].depth; i < from->textureStack [j].depth; i++) { diff_api.PopMatrix(); } from->textureStack[j].depth = to->textureStack[j].depth; } for (i = from->textureStack[j].depth; i <= to->textureStack[j].depth; i++) { if (textureFrom->curTextureUnit != j) { diff_api.ActiveTextureARB( j + GL_TEXTURE0_ARB ); textureFrom->curTextureUnit = j; } LOADMATRIX(to->textureStack[j].stack + i); from->textureStack[j].stack[i] = to->textureStack[j].stack[i]; /* Don't want to push on the current matrix */ if (i != to->textureStack[j].depth) diff_api.PushMatrix(); } from->textureStack[j].depth = to->textureStack[j].depth; from->textureStack[j].top = from->textureStack[j].stack + from- >textureStack[j].depth; } |