[PATCH 2/5] wined3d: Use the FBO cache in stretch_rect_fbo().

Henri Verbeet hverbeet at codeweavers.com
Wed May 5 11:22:35 CDT 2010


---
 dlls/wined3d/context.c         |    2 +-
 dlls/wined3d/device.c          |    8 ++------
 dlls/wined3d/wined3d_private.h |    2 ++
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index ae4f754..24624ab 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -470,7 +470,7 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ
 }
 
 /* GL locking is done by the caller */
-static void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
+void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
         IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil)
 {
     if (surface_is_offscreen(render_target))
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3001b3b..f001591 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5808,11 +5808,9 @@ void stretch_rect_fbo(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surfa
     } else {
         TRACE("Source surface %p is offscreen\n", src_surface);
         ENTER_GL();
-        context_bind_fbo(context, GL_READ_FRAMEBUFFER, &context->src_fbo);
-        context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, src_surface);
+        context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, src_surface, NULL);
         glReadBuffer(GL_COLOR_ATTACHMENT0);
         checkGLcall("glReadBuffer()");
-        context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER, NULL, FALSE);
     }
     LEAVE_GL();
 
@@ -5847,10 +5845,8 @@ void stretch_rect_fbo(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surfa
         TRACE("Destination surface %p is offscreen\n", dst_surface);
 
         ENTER_GL();
-        context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, &context->dst_fbo);
-        context_attach_surface_fbo(context, GL_DRAW_FRAMEBUFFER, 0, dst_surface);
+        context_apply_fbo_state_blit(context, GL_DRAW_FRAMEBUFFER, dst_surface, NULL);
         context_set_draw_buffer(context, GL_COLOR_ATTACHMENT0);
-        context_attach_depth_stencil_fbo(context, GL_DRAW_FRAMEBUFFER, NULL, FALSE);
     }
     glDisable(GL_SCISSOR_TEST);
     IWineD3DDeviceImpl_MarkStateDirty(device, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index cad88b9..8181b31 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1196,6 +1196,8 @@ void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImp
 void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device,
         IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil) DECLSPEC_HIDDEN;
 void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN;
+void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
+        IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil) DECLSPEC_HIDDEN;
 void context_attach_depth_stencil_fbo(struct wined3d_context *context,
         GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN;
 void context_attach_surface_fbo(const struct wined3d_context *context,
-- 
1.6.4.4




More information about the wine-patches mailing list