Slow textures on Radeon X600

Hi All,
I’ve loaded a texture in the following way:


                ByteBuffer bb = ByteBuffer.wrap(bs);
    		
    		gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT,1);
    		
    		int[] ids = new int[1];
    		gl.glGenTextures(1,ids,0);
    		int id = ids[0];
    		gl.glBindTexture(GL.GL_TEXTURE_2D,id);
    		gl.glTexImage2D(
    			GL.GL_TEXTURE_2D,0,4,w,h,0,GL.GL_RGBA,GL.GL_UNSIGNED_BYTE,bb);
    		gl.glTexParameterf(
    			GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_S,GL.GL_REPEAT);
    		gl.glTexParameterf(
    			GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_T,GL.GL_REPEAT);
    		gl.glTexParameterf(
    			GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_LINEAR);
    		gl.glTexParameterf(
    			GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_LINEAR);
    		gl.glTexEnvf(
    			GL.GL_TEXTURE_ENV,GL.GL_TEXTURE_ENV_MODE,GL.GL_MODULATE);

This works fine on a GF 6800, but I have problems on a X600. The texture displays correctly, but rendering is extremely slow - around 5fps for just a few textures. Does anyone know if there’s something I’m missing?

Thanks,
Chris

I should add that size of the texture is 100 x 100.

AFAIK ATIs doesn’t support non-power-of-two textures.

Actually they sort of do, there are just a few stipulations, no mipmapping and I assume GL_REPEAT doesn’t work. I’ve used GL_CLAMP_TO_BOARDER instead and that works. But as far as I can tell their NPOTs are effectively texture rectangles with the standard fp texture coordinates instead of integer values.

I assume you are detecting NPOT support through either the ATI extension or OpenGL 2.0 being reported? I assume this is the reason that jogl uses the ARB extension to correctly identify fully compliant platforms.

Now I’m curious just for my own information but is your GPU a Mobility Radeon X600 or is is the standard desktop Radeon X600?

Thanks guys, NPOT was the problem. I wasn’t actually checking for the extension as I read somewhere that OpenGL 2 (which I’m using) now supported NPOT, however on checking the extensions string it was not supported. I’m not sure whether REPEAT was working or not as the textures were not intended to repeat anyway.
And it’s actually a Mobility X600 - I should have mentioned that.
Cheers,
Chris.

IIRC NPOT is required for GL2, but as you found, “supported” doesn’t mean “fast”.

The hardware doesn’t support NPOTs, but it does support rectangle textures (which is a slightly different thing and requires special handle). Possibly the driver converts all NPOT creation and handling to rectangle textures in order to support them, but resulting in slow performance (IIRC, rectangle textures are a different texture target than GL_TEXTURE_2D and they require special binding).

But you can still use “accelerated” NPOTs if you stay away from the unsupported features, otherwise since they report GL2 they have to emulate it and that is what kills performance.

If it’s GL2.0 it doesn’t actually need to report the ARB extension anymore, though I get the impression they still will.

[quote]I’m not sure whether REPEAT was working or not as the textures were not intended to repeat anyway.
[/quote]
I’m sure REPEAT was in fact working it was just falling back to emulation on the CPU, but if it’s not intended to repeat see about using one of the clamp modes, I believe they are all accelerated.

[quote]And it’s actually a Mobility X600
[/quote]
Well I was just curious if the desktop X600 still didn’t support full NPOTs, because the mobility X600 is based on a much older part which exhibits the partial accelerated NPOT support.

  • Chris

Check which gfx cards support GL_ARB_texture_non_power_of_two here - notice anything missing :slight_smile:

(and yes, they have info for ATI cards, although there aren’t any 2XXX cards there yet)