VertexBuffers: Lock/Unlock and same memory address....

If i create only one static vertex buffer in my program and i do:
Lock/Unlock....Lock/Unlock....Lock/Unlock....etc - all this calls return me same start memory address for vertex buffer data if this buffer not been recreated or not
P.S. sorry for my english pls :)


Answer this question

VertexBuffers: Lock/Unlock and same memory address....

  • PierreEric

    It might or it might not. But do NOT assume you will always get the same address. Also, NEVER write to the address without doing a Lock first, and ALWAYS use the new address. It will work on some cards, and not on others.

  • bbyrd

    Tom is correct - it depends on what pool the VB was created in, what lock flags are used, etc.  It will also depend on the driver behavior, and may change even by driver revisions.

    Also as Tom said, since you have to Lock to write to the VB, there's no reason not use the new memory address you just got with the most recent Lock call.

  • VertexBuffers: Lock/Unlock and same memory address....