From 5a7091b8f7de60878e01fbdf4643ea67b9dc0e65 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 2 Sep 2010 19:25:01 +0200 Subject: [PATCH] wined3d: Do not preload buffers while under the GL lock in process_vertices_strided(). --- dlls/wined3d/device.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 01e3e907c73..517e8737bde 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3760,6 +3760,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantF( } /* Context activation is done by the caller. */ +/* Do not call while under the GL lock. */ #define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size) static HRESULT process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCount, const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD dwFlags, @@ -3784,9 +3785,6 @@ static HRESULT process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIn return WINED3DERR_INVALIDCALL; } - /* We might access VBOs from this code, so hold the lock */ - ENTER_GL(); - if (!dest->resource.allocatedMemory) buffer_get_sysmem(dest, gl_info); @@ -4089,22 +4087,27 @@ static HRESULT process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIn } } - if(dest_conv) { + if (dest_conv) + { + ENTER_GL(); + GL_EXTCALL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, dest->buffer_object)); checkGLcall("glBindBufferARB(GL_ARRAY_BUFFER_ARB)"); GL_EXTCALL(glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, dwDestIndex * get_flexible_vertex_size(DestFVF), dwCount * get_flexible_vertex_size(DestFVF), dest_conv_addr)); checkGLcall("glBufferSubDataARB(GL_ARRAY_BUFFER_ARB)"); + + LEAVE_GL(); + HeapFree(GetProcessHeap(), 0, dest_conv_addr); } - LEAVE_GL(); - return WINED3D_OK; } #undef copy_and_next +/* Do not call while under the GL lock. */ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IWineD3DBuffer *pDestBuffer, IWineD3DVertexDeclaration *pVertexDecl, DWORD Flags, DWORD DestFVF)