Module: wine Branch: master Commit: 10f58c14bcdeba9f7ea82701b9d9ab8f2bb3414b URL: http://source.winehq.org/git/wine.git/?a=commit;h=10f58c14bcdeba9f7ea82701b9...
Author: Roderick Colenbrander thunderbird2k@gmail.com Date: Mon Apr 12 12:08:06 2010 +0200
wined3d: Improve FBO support in ClearSurface.
---
dlls/wined3d/device.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6cd2831..91e595c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4377,6 +4377,29 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac }
context = context_acquire(This, (IWineD3DSurface *)target, CTXUSAGE_CLEAR); + if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) + { + if (!surface_is_offscreen((IWineD3DSurface *)target)) + { + TRACE("Surface %p is onscreen\n", target); + + ENTER_GL(); + context_bind_fbo(context, GL_FRAMEBUFFER, NULL); + context_set_draw_buffer(context, surface_get_gl_buffer((IWineD3DSurface *)target)); + LEAVE_GL(); + } + else + { + TRACE("Surface %p is offscreen\n", target); + + ENTER_GL(); + context_bind_fbo(context, GL_FRAMEBUFFER, &context->dst_fbo); + context_attach_surface_fbo(context, GL_FRAMEBUFFER, 0, (IWineD3DSurface *)target); + context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, NULL, FALSE); + LEAVE_GL(); + } + } + if (!context->valid) { context_release(context);