Jump to content
  • Advertisement
Sign in to follow this  
metsfan

OpenGL Texture Swapping: Does size matter?

This topic is 2051 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, 

 

I am wondering something about texture swapping, hoping someone can shed some light.  Question is simple:  If I swap to a different texture unit, whether it be DirectX or OpenGL, will the operation take longer depending on the size of a texture?  In other words, is a texture swap to a 64x64 texture the same cost as a 2048x2048 texture?  Is it just like changing a pointer, or does it actually have to move the memory to make it accessible to the GPU?  It is safe to assume in this situation the textures are fully initialized and have already been rendered with already (so the data is guarenteed to be in GPU memory), and that the data will not change for the runtime of the application.

 

It seems intuitive to me that it would take longer for the larger texture swap, but I have found more than once that the GPU does things that surprise me, so any knowledge here would be great.  Thank you.

Edited by metsfan

Share this post


Link to post
Share on other sites
Advertisement

If you're talking about standard desktop GPU's, binding a texture generally isn't going to cause any memory to move around. For dedicated GPU's the driver is going to keep all of your textures in GPU memory as long as everything fits, and so the "swap" is mostly a CPU-side operation involving pointers. In that case the size of the texture shouldn't have any bearing on the cost of switching.

 

Perfect, thanks.  Yes, I was referring to dedicated desktop GPUs.  

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!