Skip to content
Snippets Groups Projects
Commit e40bb4a8 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment