I was learning about glMapBuffer(), and it appears that it returns a pointer upon success. At first, I thought: "Great! Direct access to GPU memory, and I no longer need to allocate a separate pool of memory client-side only to copy it into the GPU with glBufferSubData(). I can literally even load raw data from files using glMapBuffer()." Then, I saw that I needed to call glUnmapBuffer() once I was finished --albeit to commit my changes. I got the suspicion that glMapBuffer() is really copying whatever data to a client-side pool, then copying the modified data back, and destroying the temporary pool once glUnmapBuffer()'s called. Then, I read glMapBuffer()'s description on OpenGL.org's website:
glMapBuffer maps to the client's address space the entire data store of the buffer object currently bound to target
Interesting wordage there... glMapBuffer() "maps" to the client's address space? At first, I thought glMapBuffer() actually returned a pointer to the GPU's memory, but now it sounds like glMapBuffer()'s doing behind-the-scenes client-side copying, depending on the driver. Is my suspicion correct?
I thought operating systems typically provide ALL memory, regardless of where in the system it's located, its own unique range of memory addresses. For example, memory address 0x00000000 to 0x2000000 point to main system memory while 0x20000001 to 0x2800000 all point to the GPU's memory. These memory ranges are dictated by the amount of recognized system memory, and GPU memory (including virtual memory stored in page files). Of course, firmware in simpler devices, such as older consoles, would have a fixed, possibly documented, memory map, since consoles' hardware can almost never be upgraded.