PDA

View Full Version : glCopyTexImage2D + GL_TEXTURE_RECTANGLE on Ati board bug



muratmat
12-27-2005, 07:09 AM
Hi, i've an ATI 9600XT with Catalyst 5.13
I have a strange bug that seems to be associated to the use of glCopyTexImage2D function and rectangular textures. Here's the code:


// grab a frame buffer portion and put into a texture
glEnable(GL_TEXTURE_RECTANGLE_EXT);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &texID);
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, texID);
glTexParameteri(Shot.Target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(Shot.Target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexParameteri(Shot.Target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(Shot.Target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glCopyTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, 10, 10, 200, 200, 0);

....

// use the texture
glEnable(GL_TEXTURE_RECTANGLE_EXT);
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, texID);
glBegin(GL_TRIANGLES);
glTexCoord2i(0, 150);
glVertex2i(30, 40);
glTexCoord2i(150, 150);
glVertex2i(55, 340);
glTexCoord2i(150, 0);
glVertex2i(230, 400);
glEnd();On NVivia cards works fine, on ATI boards after some frames it crashes the entire system (code execution crashes inside mlock.c file at line LeaveCriticalSection( _locktable[locknum].lock )), the only solution i've found is to not use rectangular textures (and use instead normal power-of-two textures). The bug quickly arises when the window is continually resized.
Has anyone faced the same problem? Are there better solutions/workarounds?

Thank you in advance,
Turbo - www.amanith.org (http://www.amanith.org)

PS: the platform is Windows XP Professional SP2, and OpenGL context is opened with an 8bit stencil, no multisamples, no alpha buffer, and the desktop is 32bit.