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