SDL_Texture Scope

When using SDL_Texture(s) within my full screen application, do I need to be concerned about memory losses whilst the app is minimized - is there a chance that the OS will release VRAM in order to allocated it to the currently active app?

If this is the case, how can I check the validity of an existing SDL_Texture before attempting to use it again?

Please note: as all of my textures are unlikely to fit into VRAM at the same time, I will be using SDL_Surface as a backing store and reusing textures as and when appropriate, but I really need to know if I can count on a previously allocated SDL_Texture until expicitly destroyed by my application.

Any advice would be gratefully received.

That is definitely a job for the underlying driver and not for you to worry about. The driver will transfer textures between VRAM and RAM when required. The driver will even create certain textures in RAM before first usage which will transfer them to VRAM later on.

Do not try to overthink this. You will cause more issues with some imaginary SDL Surface backends than just letting the driver to take care of it (just SDL textures).

However, if the GPU shares VRAM with RAM it might act differently, so texture creation might fail due to out of memory error. If that happens you might as well release any existing hardware texture which you don’t need and try to allocate texture once again. That being said, once the texture is created it should never be destroyed on its own (so you will have to explicitly free it yourself).