Commit 49c4623b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: device_clear_render_targets() never fails.

parent 3ba95e2f
......@@ -637,7 +637,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
}
/* Do not call while under the GL lock. */
HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb,
void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb,
UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color,
float depth, DWORD stencil)
{
......@@ -673,7 +673,7 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
{
context_release(context);
WARN("Invalid context, skipping clear.\n");
return WINED3D_OK;
return;
}
if (target)
......@@ -702,7 +702,7 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
{
context_release(context);
WARN("Failed to apply clear state, skipping clear.\n");
return WINED3D_OK;
return;
}
ENTER_GL();
......@@ -819,8 +819,6 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
wglFlush(); /* Flush to ensure ordering across contexts. */
context_release(context);
return WINED3D_OK;
}
ULONG CDECL wined3d_device_incref(struct wined3d_device *device)
......@@ -3958,10 +3956,10 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
}
wined3d_get_draw_rect(&device->stateBlock->state, &draw_rect);
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
&device->fb, rect_count, rects, &draw_rect, flags, color, depth, stencil);
return device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
&device->fb, rect_count, rects,
&draw_rect, flags, color, depth, stencil);
return WINED3D_OK;
}
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
......
......@@ -6447,8 +6447,9 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
struct wined3d_fb_state fb = {&dst_surface, NULL};
return device_clear_render_targets(device, 1, &fb,
1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
return WINED3D_OK;
}
/* Do not call while under the GL lock. */
......@@ -6458,8 +6459,9 @@ static HRESULT ffp_blit_depth_fill(struct wined3d_device *device,
const RECT draw_rect = {0, 0, surface->resource.width, surface->resource.height};
struct wined3d_fb_state fb = {NULL, surface};
return device_clear_render_targets(device, 0, &fb,
1, rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0);
device_clear_render_targets(device, 0, &fb, 1, rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0);
return WINED3D_OK;
}
const struct blit_shader ffp_blit = {
......
......@@ -1788,7 +1788,7 @@ struct wined3d_device
struct list patches[PATCHMAP_SIZE];
};
HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb,
void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb,
UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags,
const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
BOOL device_context_add(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
......
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