Results 1 to 3 of 3

Thread: Does glTexImage2D copy the texture data?

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    21

    Does glTexImage2D copy the texture data?

    Sorry if this is a bit of an odd question, but I've not worked with Textures much so I need to double check.

    When calling glTexImage2D and providing a pointer to the pixel data, is the data from that array actually copied elsewhere in memory or just pointed to? According to the behavior when the pixel value is given NULL (allocating texture memory based on the width, height and format), I would think it's copied but I just want to be sure.

    Thanks,
    Jeremiah

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Does glTexImage2D copy the texture data?

    Yes, it is copied. You can safely free/delete the pixel data immediately after glTexImage2D returns.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    21

    Re: Does glTexImage2D copy the texture data?

    Thanks for the quick and easy answer. Glad I checked... would hate to be sitting on two copies of the gfx in memory for no reason.

    Take care,
    Jeremiah

Similar Threads

  1. Async kernel execution and data copy
    By shiftreduce in forum OpenCL
    Replies: 5
    Last Post: 11-12-2009, 11:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •