opengl - does glMapBuffer copy data? -


i new opengl. question is: glmapbuffer behind scenes? allocate new host memory, copies gl object data , and returns pointer?

is gauranteed receive same pointer subsequent calls method? ofcourse releasing in between.

like often, answer "it depends". in situations glmapbuffer indeed allocate memory through malloc, copy data there use , glunmapbuffer releases it.

however common way implement glmapbuffer, through memory mapping. if don't know is, take @ documentation of syscalls mmap (*nix systems linux, macos x) or createfilemap. happens there kind of interesting: modern operating systems manage running processes' address space in virtual memory. everytime "memory" accessed os' memory management uses accessed address index translation table, redirect operation system ram, swap space, etc. (of course details quite involved, memory management 1 of more difficult things in kernel understand). driver can install own access handler. process can mmap managed driver address space , everytime performs access on this, driver's mmap handler gets called. allows driver map gpu memory (through dma) process' address space , neccessary bookkeeping. in situation glmapbuffer create such memory mapping , pointer recieve point address space in process, has been mapped dma memory reserved gpu.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -