wined3d: Fix context_apply_clear_state with ORM = backbuffer.

This commit is contained in:
Matteo Bruni 2010-08-07 15:29:41 +02:00 committed by Alexandre Julliard
parent e0528084b1
commit c1450356a7
1 changed files with 19 additions and 12 deletions

View File

@ -1972,7 +1972,7 @@ static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit
{ {
ENTER_GL(); ENTER_GL();
glDrawBuffer(surface_get_gl_buffer(rt)); glDrawBuffer(surface_get_gl_buffer(rt));
checkGLcall("glDrawBuffers()"); checkGLcall("glDrawBuffer()");
LEAVE_GL(); LEAVE_GL();
} }
else else
@ -2172,8 +2172,11 @@ void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceIm
} }
else else
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; ENTER_GL();
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
for (i = 0; i < gl_info->limits.buffers; ++i) for (i = 0; i < gl_info->limits.buffers; ++i)
{ {
if (i < rt_count && rts[i]) if (i < rt_count && rts[i])
@ -2181,14 +2184,18 @@ void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceIm
else else
context->draw_buffers[i] = GL_NONE; context->draw_buffers[i] = GL_NONE;
} }
ENTER_GL();
GL_EXTCALL(glDrawBuffersARB(gl_info->limits.buffers, context->draw_buffers)); GL_EXTCALL(glDrawBuffersARB(gl_info->limits.buffers, context->draw_buffers));
checkGLcall("glDrawBuffers()"); checkGLcall("glDrawBuffers()");
LEAVE_GL();
context->draw_buffer_dirty = TRUE; context->draw_buffer_dirty = TRUE;
} }
else
{
glDrawBuffer(device->offscreenBuffer);
checkGLcall("glDrawBuffer()");
}
LEAVE_GL();
}
if (context->last_was_blit) if (context->last_was_blit)
{ {