Module: wine Branch: master Commit: 9ba3f389f665aae45b6a8a6861f9621b020e5c25 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9ba3f389f665aae45b6a8a6861... Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Sun Jul 8 23:33:48 2007 +0200 wined3d: Initialize surfaces at creation. --- dlls/wined3d/surface.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 027f8f1..07467be 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3464,13 +3464,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) { This->glRect.bottom = This->pow2Height; } - if(GL_SUPPORT(APPLE_CLIENT_STORAGE) && This->resource.allocatedMemory == NULL) { - /* Make sure that memory is allocated from the start if we are going to use GL_APPLE_client_storage. - * Otherwise a glTexImage2D with a NULL pointer may be done, e.g. when blitting or with offscreen render - * targets, thus the client storage wouldn't be used for that texture + if(This->resource.allocatedMemory == NULL) { + /* Make sure memory exists from the start, and it is initialized properly. D3D initializes surfaces, + * gl does not, so we need to upload zeroes to init the gl texture. */ This->resource.allocatedMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->resource.size + 4); } + This->Flags |= SFLAG_INSYSMEM; + return WINED3D_OK; }