wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_modify_ds_location().

This commit is contained in:
Henri Verbeet 2010-04-18 22:50:44 +02:00 committed by Alexandre Julliard
parent ae46589f53
commit efb3993a3a
5 changed files with 13 additions and 15 deletions

View File

@ -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);
}
}

View File

@ -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 */

View File

@ -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. */

View File

@ -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);
}
}

View File

@ -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;