PDA

View Full Version : OpenGL best practices



devnull
05-20-2010, 10:04 PM
Hi all, I am an new to OpenGL, but I am curious what your opinion is of this thread:
http://forums.battle.net/thread.html?topicId=25026662470&sid=5000

Is it reasonable behavior to fill your vram with textures?

Groovounet
05-21-2010, 02:47 AM
As far as the graphics memory is not full, yes.

Is we load to much memory and the GPU need to make space, it will send the texture on CPU memory which is going to make the software really slower and possibly super slow if it happen all the time.

Textures are easily shared and never duplicated (without a specific need.) Texture streaming might be reasonably fast even if not as fast as "static textures".

Create and delete of texture is slow and should be limited to loading times or carefully handle.

devnull
05-21-2010, 08:05 AM
I agree, I think the nvram is filled and forcing stuff to swap between cpu memory, which causes the program to hang and becomes really slow. They are intentionally filling the vram and blaming the resulting slowness on the graphics driver and the OS.

V-man
05-22-2010, 05:05 PM
As far as the graphics memory is not full, yes.

Is we load to much memory and the GPU need to make space, it will send the texture on CPU memory which is going to make the software really slower and possibly super slow if it happen all the time.

Textures are easily shared and never duplicated (without a specific need.) Texture streaming might be reasonably fast even if not as fast as "static textures".

Create and delete of texture is slow and should be limited to loading times or carehandle.

Actually, a texture is not sent back to the CPU. The driver always keeps a copy in RAM. If it needs to get rid of a texture from VRAM, poof, it is gone immediatly. If the texture is needed again, then some other texture gets killed in VRAM and the driver uploads the needed texture to the GPU.

devnull
05-23-2010, 07:40 AM
The driver always keeps a copy in RAM. If it needs to get rid of a texture from VRAM, poof, it is gone immediatly. If the texture is needed again, then some other texture gets killed in VRAM and the driver uploads the needed texture to the GPU.

Assuming you have lots of small textures and some you know you would never need again, is it more cost effective to delete the textures, or let the driver manage freeing the old ones from VRAM? It seems like the driver would have a hard time knowing the optimal textures to free from memory.

V-man
05-24-2010, 07:18 AM
Since the driver does memory management, I see no point in doing your own memory management. The only case where it would make sense to do your own is where you have an enormous amount such as 20GB of textures.