PDA

View Full Version : glUnmapBuffer while keeping glMapBuffer memory val



Dragon89
02-19-2012, 06:02 AM
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?

mbentrup
02-19-2012, 06:49 AM
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).

Dragon89
02-19-2012, 07:29 AM
"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.

Dragon89
02-19-2012, 07:31 AM
Does Nvidia support ARB_pinned_memory?

Alfonse Reinheart
02-19-2012, 07:53 AM
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 ;)

Dragon89
02-19-2012, 08:01 AM
I see. I guess I'll have to do an alternative CUDA based implementation for Nvidia cards.

Dragon89
02-19-2012, 08:13 AM
Does anyone know of a similar feature on Intel HD Graphics?

Alfonse Reinheart
02-19-2012, 09:50 AM
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?

Dragon89
02-19-2012, 10:14 AM
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.