Commit c830b070 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Limit clears to the size of the framebuffer.

parent 451c3769
......@@ -531,7 +531,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
unsigned int rt_count = cs->device->adapter->gl_info.limits.buffers;
const struct wined3d_state *state = &cs->device->state;
const struct wined3d_viewport *vp = &state->viewport;
struct wined3d_rendertarget_view *view;
struct wined3d_cs_clear *op;
RECT view_rect;
unsigned int i;
op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_clear, rects[rect_count]),
......@@ -553,12 +555,21 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
{
for (i = 0; i < rt_count; ++i)
{
if (state->fb->render_targets[i])
wined3d_resource_acquire(state->fb->render_targets[i]->resource);
if ((view = state->fb->render_targets[i]))
{
SetRect(&view_rect, 0, 0, view->width, view->height);
IntersectRect(&op->draw_rect, &op->draw_rect, &view_rect);
wined3d_resource_acquire(view->resource);
}
}
}
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
wined3d_resource_acquire(state->fb->depth_stencil->resource);
{
view = state->fb->depth_stencil;
SetRect(&view_rect, 0, 0, view->width, view->height);
IntersectRect(&op->draw_rect, &op->draw_rect, &view_rect);
wined3d_resource_acquire(view->resource);
}
cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment