wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_modify_ds_location().
This commit is contained in:
parent
ae46589f53
commit
efb3993a3a
|
@ -4513,7 +4513,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
|
||||||
if (Flags & WINED3DCLEAR_ZBUFFER) {
|
if (Flags & WINED3DCLEAR_ZBUFFER) {
|
||||||
/* Note that WINED3DCLEAR_ZBUFFER implies a depth stencil exists on the device */
|
/* Note that WINED3DCLEAR_ZBUFFER implies a depth stencil exists on the device */
|
||||||
DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN;
|
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();
|
LEAVE_GL();
|
||||||
|
@ -5920,11 +5920,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
|
||||||
if (This->stencilBufferTarget) {
|
if (This->stencilBufferTarget) {
|
||||||
if (((IWineD3DSwapChainImpl *)This->swapchains[0])->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
|
if (((IWineD3DSwapChainImpl *)This->swapchains[0])->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
|
||||||
|| ((IWineD3DSurfaceImpl *)This->stencilBufferTarget)->Flags & SFLAG_DISCARD) {
|
|| ((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 {
|
} else {
|
||||||
struct wined3d_context *context = context_acquire(This, This->render_targets[0], CTXUSAGE_RESOURCELOAD);
|
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_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);
|
context_release(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -614,7 +614,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
|
||||||
|| This->stateBlock->renderState[WINED3DRS_ZENABLE])
|
|| This->stateBlock->renderState[WINED3DRS_ZENABLE])
|
||||||
surface_load_ds_location((IWineD3DSurfaceImpl *)This->stencilBufferTarget, context, location);
|
surface_load_ds_location((IWineD3DSurfaceImpl *)This->stencilBufferTarget, context, location);
|
||||||
if (This->stateBlock->renderState[WINED3DRS_ZWRITEENABLE])
|
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 */
|
/* Ok, we will be updating the screen from here onwards so grab the lock */
|
||||||
|
|
|
@ -4054,17 +4054,15 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, const struct wined3d_gl
|
||||||
device->shader_backend->shader_deselect_depth_blt((IWineD3DDevice *)device);
|
device->shader_backend->shader_deselect_depth_blt((IWineD3DDevice *)device);
|
||||||
}
|
}
|
||||||
|
|
||||||
void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) {
|
void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location)
|
||||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
|
{
|
||||||
|
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) {
|
surface->Flags &= ~SFLAG_DS_LOCATIONS;
|
||||||
FIXME("(%p) Invalid location (%#x) specified\n", This, location);
|
surface->Flags |= location;
|
||||||
}
|
|
||||||
|
|
||||||
This->Flags &= ~SFLAG_DS_LOCATIONS;
|
|
||||||
This->Flags |= location;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
|
|
|
@ -464,7 +464,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
|
||||||
if (This->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
|
if (This->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
|
||||||
|| ((IWineD3DSurfaceImpl *)This->device->stencilBufferTarget)->Flags & SFLAG_DISCARD)
|
|| ((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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
GLenum surface_get_gl_buffer(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
|
||||||
void surface_load_ds_location(IWineD3DSurfaceImpl *surface,
|
void surface_load_ds_location(IWineD3DSurfaceImpl *surface,
|
||||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
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,
|
void surface_set_compatible_renderbuffer(IWineD3DSurface *iface,
|
||||||
unsigned int width, unsigned int height) DECLSPEC_HIDDEN;
|
unsigned int width, unsigned int height) DECLSPEC_HIDDEN;
|
||||||
void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
|
void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue