wined3d: Just use glBufferSubData() in buffer_direct_upload().
commit602a23a60aaab164acb8a2767094d545172ab4cf
authorHenri Verbeet <hverbeet@codeweavers.com>
Fri, 27 Jan 2017 10:36:31 +0000 (27 11:36 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 27 Jan 2017 15:31:44 +0000 (27 16:31 +0100)
tree96146e9a41cef919738d12015d840c09dd42766f
parent542998ee24fe05cf230288c47538ccf18807ec64
wined3d: Just use glBufferSubData() in buffer_direct_upload().

It might seem like a good idea to try to use glMapBufferRange() in
buffer_direct_upload(), but it really isn't. The interesting cases for
glMapBufferRange() are GL_MAP_INVALIDATE_BUFFER_BIT or
GL_MAP_UNSYNCHRONIZED_BIT, but the only way for those to be set here
would be for the buffer to be mapped with WINED3D_MAP_DISCARD or
WINED3D_MAP_NOOVERWRITE before the buffer object was created. In that
case the GPU is obviously not using the buffer object, so
glMapBufferRange() doesn't help. On the other hand, if the buffer is
currently in use by the application and neither WINED3D_MAP_DISCARD nor
WINED3D_MAP_NOOVERWRITE is set, glMapBufferRange() would need to wait
for the GPU to finish using the buffer object, while glBufferSubData()
may decide not to.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/wined3d/buffer.c