1

Is there a difference between the above as they both appear to have the same effect, my assumption is that the un-map buffer method is more optimised for un mapping rather than binding a buffer to 0 to un-map

2 Answers 2

4

Is there a difference between the above as they both appear to have the same effect,

There's not just some difference between them, they do entirely different things.

  • glBindBuffer un-/selects which buffer object the following OpenGL operations refer to.

  • glUnmapBuffer is the complementary to glMapBuffer. glMapBuffer maps the buffer to the host address space, i.e. after mapping the buffer its contents are accessible through a pointer. glUnmapBuffer releases this mapping, i.e. the buffer contents disappear from the host process address space.

Because both functionalities are orthogonal binding state has no effect on address space mappings, and address space mappings have no effect on the binding state.

Sign up to request clarification or add additional context in comments.

Comments

2

No, they do not have the same effect. Binding buffer 0 just unbinds a buffer from some binding target, it does not unmap it. The buffer mapping is still valid and can be used. You also can have multiple buffers mapped at the same time. glUnmapBuffer() just unmaps the buffer which is currenlty bound to the target point.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.