From efb3993a3adcfce05489b62ad257da70ad1bdfe1 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Sun, 18 Apr 2010 22:50:44 +0200 Subject: [PATCH] wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_modify_ds_location(). --- dlls/wined3d/device.c | 6 +++--- dlls/wined3d/drawprim.c | 2 +- dlls/wined3d/surface.c | 16 +++++++--------- dlls/wined3d/swapchain.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 547b109c543..1fb0dacd21a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4513,7 +4513,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac if (Flags & WINED3DCLEAR_ZBUFFER) { /* Note that WINED3DCLEAR_ZBUFFER implies a depth stencil exists on the device */ DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN; - surface_modify_ds_location(This->stencilBufferTarget, location); + surface_modify_ds_location(depth_stencil, location); } LEAVE_GL(); @@ -5920,11 +5920,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice * if (This->stencilBufferTarget) { if (((IWineD3DSwapChainImpl *)This->swapchains[0])->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL || ((IWineD3DSurfaceImpl *)This->stencilBufferTarget)->Flags & SFLAG_DISCARD) { - surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_DISCARDED); + surface_modify_ds_location((IWineD3DSurfaceImpl *)This->stencilBufferTarget, SFLAG_DS_DISCARDED); } else { struct wined3d_context *context = context_acquire(This, This->render_targets[0], CTXUSAGE_RESOURCELOAD); surface_load_ds_location((IWineD3DSurfaceImpl *)This->stencilBufferTarget, context, SFLAG_DS_OFFSCREEN); - surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_OFFSCREEN); + surface_modify_ds_location((IWineD3DSurfaceImpl *)This->stencilBufferTarget, SFLAG_DS_OFFSCREEN); context_release(context); } } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 03927c98a0d..ed641a6c271 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -614,7 +614,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT || This->stateBlock->renderState[WINED3DRS_ZENABLE]) surface_load_ds_location((IWineD3DSurfaceImpl *)This->stencilBufferTarget, context, location); if (This->stateBlock->renderState[WINED3DRS_ZWRITEENABLE]) - surface_modify_ds_location(This->stencilBufferTarget, location); + surface_modify_ds_location((IWineD3DSurfaceImpl *)This->stencilBufferTarget, location); } /* Ok, we will be updating the screen from here onwards so grab the lock */ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index d376e28ecb0..a91acb14f6e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -4054,17 +4054,15 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, const struct wined3d_gl device->shader_backend->shader_deselect_depth_blt((IWineD3DDevice *)device); } -void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) { - IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; +void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location) +{ + TRACE("surface %p, new location %#x.\n", surface, location); - TRACE("(%p) New location %#x\n", This, location); + if (location & ~SFLAG_DS_LOCATIONS) + FIXME("Invalid location (%#x) specified.\n", location); - if (location & ~SFLAG_DS_LOCATIONS) { - FIXME("(%p) Invalid location (%#x) specified\n", This, location); - } - - This->Flags &= ~SFLAG_DS_LOCATIONS; - This->Flags |= location; + surface->Flags &= ~SFLAG_DS_LOCATIONS; + surface->Flags |= location; } /* Context activation is done by the caller. */ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 8c78fac84fb..934979bdbcd 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -464,7 +464,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO if (This->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL || ((IWineD3DSurfaceImpl *)This->device->stencilBufferTarget)->Flags & SFLAG_DISCARD) { - surface_modify_ds_location(This->device->stencilBufferTarget, SFLAG_DS_DISCARDED); + surface_modify_ds_location((IWineD3DSurfaceImpl *)This->device->stencilBufferTarget, SFLAG_DS_DISCARDED); } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 42bafca7845..9bcfc7fc882 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2679,7 +2679,7 @@ void surface_add_dirty_rect(IWineD3DSurface *iface, const RECT *dirty_rect) DECL GLenum surface_get_gl_buffer(IWineD3DSurface *iface) DECLSPEC_HIDDEN; void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) DECLSPEC_HIDDEN; +void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location) DECLSPEC_HIDDEN; void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height) DECLSPEC_HIDDEN; void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;