Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: glUnmapBuffer while keeping glMapBuffer memory val

  1. #1
    Intern Newbie
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    49

    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?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Dec 2009
    Posts
    212

    Re: glUnmapBuffer while keeping glMapBuffer memory val

    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).

  3. #3
    Intern Newbie
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    49

    Re: glUnmapBuffer while keeping glMapBuffer memory val

    "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.

  4. #4
    Intern Newbie
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    49

    Re: glUnmapBuffer while keeping glMapBuffer memory val

    Does Nvidia support ARB_pinned_memory?

  5. #5
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: glUnmapBuffer while keeping glMapBuffer memory val

    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

  6. #6
    Intern Newbie
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    49

    Re: glUnmapBuffer while keeping glMapBuffer memory val

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

  7. #7
    Intern Newbie
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    49

    Re: glUnmapBuffer while keeping glMapBuffer memory val

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

  8. #8
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: glUnmapBuffer while keeping glMapBuffer memory val

    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?

  9. #9
    Intern Newbie
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    49

    Re: glUnmapBuffer while keeping glMapBuffer memory val

    Quote Originally Posted by Alfonse Reinheart
    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.

Posting Permissions

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