Jump to content
  • Advertisement
Sign in to follow this  
dimensionX

Texture Downloading

This topic is 4824 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

NVIDIA Geforce 7800 GTX Forceware 77.72 drivers glGenTextures(1, &id); glBindTexture(GL_TEXTURE_2D, id); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); if(pixels == 0) ==> Is memory allocated for the texture on the GPU ? If not when is it allocated ? if(pixels != 0) ==> Is memory allocated for the texture on the GPU or is it (pixels) buffered somewhere else (ex:- PCIExpress memory) ? In either of the above cases, how to know if the memory is allocated on the GPU ? In either case, is the memory allocate on the GPU when it is: 1) first used as a destination of an FBO 2) first time bound for texture mapping 3) first time it is bound and another glTexImage2D/glTexSubImage2D call is made

Share this post


Link to post
Share on other sites
Advertisement
It depends somewhat on the driver as to what happens when as I dont believe the spec puts any restraints on it, however you might want to check to find out for yaself....

Share this post


Link to post
Share on other sites
Quote:
Original post by dimensionX
if(pixels == 0)
==> Is memory allocated for the texture on the GPU ? If not when is it allocated ?

Texture memory is probably not yet allocated if you don't specify source memory on texture creation, but this decision is upon the driver. It could very well already allocate an empty texture.

Quote:
Original post by dimensionX
if(pixels != 0)
==> Is memory allocated for the texture on the GPU or is it (pixels) buffered somewhere else (ex:- PCIExpress memory) ?

It is allocated somewhere. This 'somewhere' is entirely upon the driver, and will change during rendering operation. Usually, a memory copy is allocated in system RAM, and this is then uploaded to the GPU on demand (and removed if it is not used anymore, it's controlled through a caching scheme). But there is no way to rely on specific allocation behaviour, nor is there the need to.

Quote:
Original post by dimensionX
In either of the above cases, how to know if the memory is allocated on the GPU ?

There is no way to know, and there is no reason to either.

Quote:
Original post by dimensionX
In either case, is the memory allocate on the GPU when it is:
1) first used as a destination of an FBO
2) first time bound for texture mapping
3) first time it is bound and another glTexImage2D/glTexSubImage2D call is made

Entirely driver and hardware specific. The driver will manage everything in the best possible way. Don't worry about this stuff.

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!