Possible problem in crStateTransformDiff (state_transform.c)

[email protected] Sun, 24 Jul 2005 20:27:22 -0600
Newsgroups gmane.comp.graphics.chromium.devel
Message-ID <[email protected]>
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;
}


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click