glUnmapBuffer while keeping glMapBuffer memory val

Is it possible to glUnmapBuffer a GL_STREAM_DRAW pixel-buffer-object and still keep the data pointed by the pointer returned previously by glMapBuffer valid for read-only operations using SSE 4.1 streaming loads?

No, the OpenGL implementation may use that memory address for something else once it is unmapped.

Also reading from a mapped buffer may be slower than reading from system memory, so I’d keep the data in system memory and just memcpy it into the buffer object.

PS: AMD has an extension that allows the GPU to use system memory buffers (GL_ARB_pinned_memory).

“Also reading from a mapped buffer may be slower than reading from system memory, so I’d keep the data in system memory and just memcpy it into the buffer object.”

Streaming loads solve this problem.

Does Nvidia support ARB_pinned_memory?

Well, there is no ARB_pinned_memory, so no. What he was talking about is AMD_pinned_memory, so the odds are pretty low for an NVIDIA implementation :wink:

I see. I guess I’ll have to do an alternative CUDA based implementation for Nvidia cards.

Does anyone know of a similar feature on Intel HD Graphics?

I guess I’ll have to do an alternative CUDA based implementation for Nvidia cards.

Does CUDA actually give you direct read access to a block of GPU memory that’s currently being used?

I don’t know. But it gives access to the pinned memory that is currently being uploaded to the GPU, which is what I want.