wined3d: Do not preload buffers while under the GL lock in process_vertices_strided().

This commit is contained in:
Henri Verbeet 2010-09-02 19:25:01 +02:00 committed by Alexandre Julliard
parent bc2db78c3a
commit 5a7091b8f7
1 changed files with 9 additions and 6 deletions

View File

@ -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)");
HeapFree(GetProcessHeap(), 0, dest_conv_addr);
}
LEAVE_GL();
HeapFree(GetProcessHeap(), 0, dest_conv_addr);
}
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)