GL_PIXEL_UNPACK_BUFFER, texture and VRAM usage

This topic contains 2 replies, has 2 voices, and was last updated by  Slion 2 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43040

    Slion
    Member

    If multiple textures are constructed using the same GL_PIXEL_UNPACK_BUFFER do they share the same VRAM?
    What of generated mipmaps are they also attached to the buffer rather than the texture?

    #43376

    PaulL
    Admin

    Multiple textures won’t share the same memory, they exist as separate objects. When you call glTexImage2D() or glTexSubImage2D() texture data is copied to the bound texture object.

    The difference is, when you pass a pointer from application memory to glTexImage2D(), the driver performs an upload to the GPU transparently into a buffer, it then performs a second copy from that buffer into the bound texture object. A buffer object bound to PIXEL_UNPACK_BUFFER is memory already on the GPU, so glTexImage2D() can skip the upload and perform the copy into the texture object directly from internal memory.

    #43789

    Slion
    Member

    That’s what I was afraid of. So it just saves us multiple upload which makes sense when planning to use a pixel buffer in multiple texture object. However it comes at an extra cost in VRAM usage.

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.