Reputation: 181
As we all know, OpenGL and many image/video formats differ in the origin of the pixel data. So when we draw an image (especially a live image from a camera) using OpenGL, we have the following options.
Now, I don't want to flip the image because it is not free (processing cost) and we may need to do one of the following in case we continue using the image on CPU:
Both uses extra memory and processing power. (I know new buffer in the first case can be allocated once. Still it consumes memory and flipping is done on CPU.)
So I understand we should use approach (2) above and be extremely careful about flipping texture coordinates correctly. I keep hearing this is the faster approach, however, what no one touching is how fast the GPU will access the textures when we give flipped texture coordinates. Nowadays, many computers (laptops) have integrated GPU which uses the system memory. Wouldn't the texture lookup speed be affected by the way we give texture coordinates?
In summary, my question boils down to this: would texture look-up and filtering speed change depending on the actual layout of the texture in GPU memory? I would like to know this both for dedicated GPUs like nvidia, and integrated GPUs like intels.
PS: This is purely for educational purposes, I realize knowing the answer to this question won't matter much for the application performance, but it's always good to have some inner knowledge. Also I'm curious :)
Upvotes: 1
Views: 1166
Reputation: 5903
The TL/DR answer is: No, there would be no perceptible speed change whatsoever.
GPUs, regardless of their origin (NV, AMD, Intel — whoever the manufacturer is), are just designed that way. Texture maps are ubiquitous in modern 3D graphics, so if a GPU can`t cope with affine texture transformations then it`s a bad and unmarketable GPU.
Upvotes: 3