Module: wine Branch: master Commit: dcc490e82ff47ae178353927e2ba28d213f3e090 URL: http://source.winehq.org/git/wine.git/?a=commit;h=dcc490e82ff47ae178353927e2...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Fri Jun 19 11:04:31 2009 +0200
wined3d: Don't load a rendertarget just because alpha test is enabled.
Unlike the depth test, the alpha test doesn't compare to the existing fragment but against a reference value.
---
dlls/wined3d/drawprim.c | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 5ff7477..c644aa2 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -554,22 +554,21 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DSurfaceImpl *target; - BOOL load_rt, modify_rt; unsigned int i;
if (!index_count) return;
- load_rt = This->stateBlock->renderState[WINED3DRS_COLORWRITEENABLE] - || This->stateBlock->renderState[WINED3DRS_ALPHATESTENABLE] - || This->stateBlock->renderState[WINED3DRS_COLORKEYENABLE]; - modify_rt = This->stateBlock->renderState[WINED3DRS_COLORWRITEENABLE]; - - /* Invalidate the back buffer memory so LockRect will read it the next time */ - for(i = 0; i < GL_LIMITS(buffers); i++) { - target = (IWineD3DSurfaceImpl *) This->render_targets[i]; - if (target) { - if (load_rt) IWineD3DSurface_LoadLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, NULL); - if (modify_rt) IWineD3DSurface_ModifyLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, TRUE); + if (This->stateBlock->renderState[WINED3DRS_COLORWRITEENABLE]) + { + /* Invalidate the back buffer memory so LockRect will read it the next time */ + for (i = 0; i < GL_LIMITS(buffers); ++i) + { + target = (IWineD3DSurfaceImpl *)This->render_targets[i]; + if (target) + { + IWineD3DSurface_LoadLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, NULL); + IWineD3DSurface_ModifyLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, TRUE); + } } }