wined3d: Do not try to read the vertex decl when the stateblock isn't finalized.
This commit is contained in:
parent
2e55c196ee
commit
9f2e0fa2e0
|
@ -1247,6 +1247,9 @@ void drawPrimitive(IWineD3DDevice *iface,
|
|||
DWORD dirtyState, idx;
|
||||
BYTE shift;
|
||||
|
||||
/* Signals other modules that a drawing is in progress and the stateblock finalized */
|
||||
This->isInDraw = TRUE;
|
||||
|
||||
/* Invalidate the back buffer memory so LockRect will read it the next time */
|
||||
for(i = 0; i < IWineD3DDevice_GetNumberOfSwapChains(iface); i++) {
|
||||
IWineD3DDevice_GetSwapChain(iface, i, (IWineD3DSwapChain **) &swapchain);
|
||||
|
@ -1340,4 +1343,7 @@ void drawPrimitive(IWineD3DDevice *iface,
|
|||
++primCounter;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Control goes back to the device, stateblock values may change again */
|
||||
This->isInDraw = FALSE;
|
||||
}
|
||||
|
|
|
@ -258,7 +258,20 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if
|
|||
return; /* Not doing any conversion */
|
||||
}
|
||||
|
||||
declChanged = IWineD3DVertexBufferImpl_FindDecl(This);
|
||||
/* Reading the declaration makes only sense if the stateblock is finalized and the buffer bound to a stream */
|
||||
if(This->resource.wineD3DDevice->isInDraw && This->Flags & VBFLAG_STREAM) {
|
||||
declChanged = IWineD3DVertexBufferImpl_FindDecl(This);
|
||||
} else if(This->Flags & VBFLAG_HASDESC) {
|
||||
/* Reuse the declaration stored in the buffer. It will most likely not change, and if it does
|
||||
* the stream source state handler will call PreLoad again and the change will be cought
|
||||
*/
|
||||
} else {
|
||||
/* Cannot get a declaration, and no declaration is stored in the buffer. It is pointless to preload
|
||||
* now. When the buffer is used, PreLoad will be called by the stream source state handler and a valid
|
||||
* declaration for the buffer can be found
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
/* If applications change the declaration over and over, reconverting all the time is a huge
|
||||
* performance hit. So count the declaration changes and release the VBO if there are too much
|
||||
|
|
|
@ -588,6 +588,7 @@ typedef struct IWineD3DDeviceImpl
|
|||
BOOL isRecordingState;
|
||||
IWineD3DStateBlockImpl *stateBlock;
|
||||
IWineD3DStateBlockImpl *updateStateBlock;
|
||||
BOOL isInDraw;
|
||||
|
||||
/* Internal use fields */
|
||||
WINED3DDEVICE_CREATION_PARAMETERS createParms;
|
||||
|
|
Loading…
Reference in New Issue