I have a few questions about textures and how they’re stored in OpenGL and/or in hardware.
Note: I’m not asking how to do it through OpenGL calls (glTexImage2D), I’m just asking about the internal workings of it.
I know very little about hardware and the first two are pretty basic hardware questions so bear with me.
I heard somewhere that textures should be stored in VRAM, so that is why the following questions are focused on that.
I know that VRAM (video RAM) is a variant of DRAM but is a VRAM a separate physical memory like DRAM, or is it part of the graphics card?
What other purposes does VRAM serve, other than to store the current framebuffer? Do all applications store the things to be rendered in VRAM by default or is it an optional thing?
When I pass in my texture data through glTexImage2D, is it being stored in VRAM? If so, (and I’m pretty sure I can do this) does that mean I can dealloc my local texture data after the call to glTexImage2D? If it’s not stored in VRAM, how can I have it so that it is?
<s>4) So if OpenGL does store the textures in VRAM along with the current framebuffer, what else does OpenGL use VRAM for?</s>
Ignore. This is pretty much question #2.
Lets say I close my application, do I need to free up the textures in VRAM myself or does OpenGL handle that for me?
How can I free up a texture in VRAM (I don’t need that texture anymore)? Through glDeleteTextures?
Suppose I have a texture in VRAM, how do I read/write each of its texture data?