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

wined3d: Render target locking fixes.

parent 473ad39d
......@@ -2069,7 +2069,8 @@ void drawPrimitive(IWineD3DDevice *iface,
BOOL usePixelShaderFunction = FALSE;
BOOL isLightingOn = FALSE;
WineDirect3DVertexStridedData *dataLocations;
int useHW = FALSE;
IWineD3DSwapChainImpl *swapchain;
int useHW = FALSE, i;
if (This->stateBlock->vertexShader != NULL && wined3d_settings.vs_mode != VS_NONE
&&((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->baseShader.function != NULL
......@@ -2093,6 +2094,15 @@ void drawPrimitive(IWineD3DDevice *iface,
TRACE("(%p) : using vertex declaration %p\n", iface, This->stateBlock->vertexDecl);
}
/* 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);
if(swapchain) {
if(swapchain->backBuffer) ((IWineD3DSurfaceImpl *) swapchain->backBuffer)->Flags |= SFLAG_GLDIRTY;
IWineD3DSwapChain_Release( (IWineD3DSwapChain *) swapchain);
}
}
/* Ok, we will be updating the screen from here onwards so grab the lock */
ENTER_GL();
......
......@@ -329,6 +329,9 @@ HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CONST REC
IWineD3DDevice_Clear((IWineD3DDevice*)This->wineD3DDevice, 0, NULL, D3DCLEAR_STENCIL|D3DCLEAR_ZBUFFER, 0x00, 1.0, 0);
}
((IWineD3DSurfaceImpl *) This->frontBuffer)->Flags |= SFLAG_GLDIRTY;
((IWineD3DSurfaceImpl *) This->backBuffer)->Flags |= SFLAG_GLDIRTY;
TRACE("returning\n");
return WINED3D_OK;
}
......
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