   crazy speed difference between GL_REPEAT and GL_CLAMP_TO_EDGE (texture repeating)
  Hey guys,I've recently hit a huge bottleneck in my program where I didn't think there would be one.  I narrowed it down to a simple scenario:* Create an OpenGL texture with the following pseudo-code:    (glTexEnvi GL_TEXTURE_ENV GL_TEXTURE_ENV_MODE GL_DECAL)    (glTexImage2D GL_TEXTURE_2D   0   GL_RGBA   width   height   0   GL_RGBA   GL_UNSIGNED_BYTE   data)    (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_LINEAR)    (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_LINEAR)    (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_S GL_REPEAT)    (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_REPEAT)* Create a loop that simply renders a quad that fills the window with the above texture applied to it (so you just see the image rendered in the window).That's basically it.  Surprisingly, for a 465x638 window, each loop iteration takes ~.55s!  However, here's the kicker, if I change the texture wrap parameters to GL_CLAMP_TO_EDGE instead of GL_REPEAT, I get the expected faster speeds of ~.002s per iteration:    (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_S GL_CLAMP_TO_EDGE)    (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_CLAMP_TO_EDGE)Is there a simple explanation for this, or is it something in my opengl initialization or drivers?I'm on OS X 10.5 and here's some of my driver information:OpenGL vendor string: ATI Technologies Inc.OpenGL renderer string: ATI Radeon X1600 OpenGL EngineOpenGL version string: 2.0 ATI-1.5.36   
  That is very strange... The drivers must be falling back to software fragment processing or something.Are you using shaders in this test or fixed function rendering?   ;  Completely fixed function.  I can explain other parts of the system too but I'm not sure what would be helpful.  I just realized that there's one thing I set in the initialization phase that could make a difference:  (glPixelStorei GL_UNPACK_ALIGNMENT 1)Would setting the pixel alignment make a difference?  I needed this for my textures to work, but I could be using it wrongly.   ;  Are you wrapping the texture many times? If so, then the chances are that your texture coordinate derivatives per pixel are so high that the videocard is thrashing the cache on each sample. If not, then maybe there is a bug in the drivers?   ;  are u using power of 2 sized textures,I dont know perhaps the GL_REPEAT with NPOT textures arent supported on in hardware for ATI Radeon X1600 for some strange reason