PBO + texture non 2n sized texture


we want to download a PBO into a texture, we use glTexSubImage2D but it works with only 2n sized (512x256) texture but we want to use a 640x480 for example… Is someone know a function to do this can he help me ???


What makes you think so? OpenGL supports it just fine. It’s more likely your hardware/driver does not support other than power-of-two textures.

However, to be sure, see if your implementation supports either of these extensions:

[ul][]ARB_texture_non_power_of_two[]ARB_texture_rectangle[/ul]If it does, you can create and manipulate non-power-of-two textures.

You can also create a power of two texture bigger than the dimension you actualy need and only use a subset of it (in your example, a 1024x512 texture would be fine).

Of course, this wastes some video memory but at least it works on all video cards.

Also, be aware that some cards may support NPOT textures but are quite slow when you use them (some may fall back to software mode), especially if you apply linear filtering to it.

Specifically, what GPU, OS, driver are we talking about?
Can you provide code and binary so that people can test?