Commit e40bb4a8 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Create a VBO before returning memory.

The state manager calls GetMemory before it calls PreLoad on the VBO, and PreLoad depends on finding the VBO in the strided vertex structure. This can cause problems on the first draw which creates the vertex buffer, because the first PreLoad creates the vbo and attempts to convert with an incorrect strided structure.
parent 7dec20d8
......@@ -801,6 +801,14 @@ BYTE* WINAPI IWineD3DVertexBufferImpl_GetMemory(IWineD3DVertexBuffer* iface, DWO
*vbo = This->vbo;
if(This->vbo == 0) {
if(This->Flags & VBFLAG_CREATEVBO) {
CreateVBO(This);
This->Flags &= ~VBFLAG_CREATEVBO;
if(This->vbo) {
*vbo = This->vbo;
return (BYTE *) iOffset;
}
}
return This->resource.allocatedMemory + iOffset;
} else {
return (BYTE *) iOffset;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment