Henri Verbeet : wined3d: Handle depth/ stencil surfaces in IWineD3DSurfaceImpl_LoadLocation().
Alexandre Julliard
julliard at winehq.org
Mon May 17 09:39:31 CDT 2010
Module: wine
Branch: master
Commit: 44ab3d70f1987b239291f753a95c93eabddddb57
URL: http://source.winehq.org/git/wine.git/?a=commit;h=44ab3d70f1987b239291f753a95c93eabddddb57
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Mon May 17 11:14:45 2010 +0200
wined3d: Handle depth/stencil surfaces in IWineD3DSurfaceImpl_LoadLocation().
---
dlls/wined3d/device.c | 1 +
dlls/wined3d/drawprim.c | 3 +++
dlls/wined3d/surface.c | 16 ++++++++++++++++
3 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2b8f231..cf23b3b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4483,6 +4483,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
if (location == SFLAG_DS_ONSCREEN && depth_stencil != This->onscreen_depth_stencil)
device_switch_onscreen_ds(This, context, depth_stencil);
prepare_ds_clear(depth_stencil, context, location, &draw_rect, Count, clear_rect);
+ IWineD3DSurface_ModifyLocation((IWineD3DSurface *)depth_stencil, SFLAG_INDRAWABLE, TRUE);
glDepthMask(GL_TRUE);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_ZWRITEENABLE));
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 1f904ea..3da4093 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -634,9 +634,12 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
surface_load_ds_location(This->depth_stencil, context, location);
if (This->stateBlock->renderState[WINED3DRS_ZWRITEENABLE])
+ {
surface_modify_ds_location(This->depth_stencil, location,
This->depth_stencil->ds_current_size.cx,
This->depth_stencil->ds_current_size.cy);
+ IWineD3DSurface_ModifyLocation((IWineD3DSurface *)This->depth_stencil, SFLAG_INDRAWABLE, TRUE);
+ }
}
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index db4a58b..4b70622 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4390,6 +4390,22 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
BOOL drawable_read_ok = TRUE;
BOOL in_fbo = FALSE;
+ if (This->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
+ {
+ if (flag == SFLAG_INTEXTURE)
+ {
+ struct wined3d_context *context = context_acquire(device, NULL);
+ surface_load_ds_location(This, context, SFLAG_DS_OFFSCREEN);
+ context_release(context);
+ return WINED3D_OK;
+ }
+ else
+ {
+ FIXME("Unimplemented location %#x for depth/stencil buffers.\n", flag);
+ return WINED3DERR_INVALIDCALL;
+ }
+ }
+
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
if (surface_is_offscreen(This))
More information about the wine-cvs
mailing list