wined3d: Use the FBO cache in stretch_rect_fbo().

This commit is contained in:
Henri Verbeet 2010-05-05 18:22:35 +02:00 committed by Alexandre Julliard
parent 9982a46296
commit 3345146d0b
3 changed files with 5 additions and 7 deletions

View File

@ -470,7 +470,7 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ
} }
/* GL locking is done by the caller */ /* 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) IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil)
{ {
if (surface_is_offscreen(render_target)) if (surface_is_offscreen(render_target))

View File

@ -5808,11 +5808,9 @@ void stretch_rect_fbo(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surfa
} else { } else {
TRACE("Source surface %p is offscreen\n", src_surface); TRACE("Source surface %p is offscreen\n", src_surface);
ENTER_GL(); ENTER_GL();
context_bind_fbo(context, GL_READ_FRAMEBUFFER, &context->src_fbo); context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, src_surface, NULL);
context_attach_surface_fbo(context, GL_READ_FRAMEBUFFER, 0, src_surface);
glReadBuffer(GL_COLOR_ATTACHMENT0); glReadBuffer(GL_COLOR_ATTACHMENT0);
checkGLcall("glReadBuffer()"); checkGLcall("glReadBuffer()");
context_attach_depth_stencil_fbo(context, GL_READ_FRAMEBUFFER, NULL, FALSE);
} }
LEAVE_GL(); LEAVE_GL();
@ -5847,10 +5845,8 @@ void stretch_rect_fbo(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surfa
TRACE("Destination surface %p is offscreen\n", dst_surface); TRACE("Destination surface %p is offscreen\n", dst_surface);
ENTER_GL(); ENTER_GL();
context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, &context->dst_fbo); context_apply_fbo_state_blit(context, GL_DRAW_FRAMEBUFFER, dst_surface, NULL);
context_attach_surface_fbo(context, GL_DRAW_FRAMEBUFFER, 0, dst_surface);
context_set_draw_buffer(context, GL_COLOR_ATTACHMENT0); context_set_draw_buffer(context, GL_COLOR_ATTACHMENT0);
context_attach_depth_stencil_fbo(context, GL_DRAW_FRAMEBUFFER, NULL, FALSE);
} }
glDisable(GL_SCISSOR_TEST); glDisable(GL_SCISSOR_TEST);
IWineD3DDeviceImpl_MarkStateDirty(device, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE)); IWineD3DDeviceImpl_MarkStateDirty(device, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));

View File

@ -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, void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device,
IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil) DECLSPEC_HIDDEN; IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil) DECLSPEC_HIDDEN;
void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) 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, void context_attach_depth_stencil_fbo(struct wined3d_context *context,
GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN; GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN;
void context_attach_surface_fbo(const struct wined3d_context *context, void context_attach_surface_fbo(const struct wined3d_context *context,