forked from Mirrors/wine-wine
wined3d: device_clear_render_targets() never fails.
parent
3ba95e2f3e
commit
49c4623b2f
|
@ -637,7 +637,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do not call while under the GL lock. */
|
/* 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,
|
UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color,
|
||||||
float depth, DWORD stencil)
|
float depth, DWORD stencil)
|
||||||
{
|
{
|
||||||
|
@ -673,7 +673,7 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
|
||||||
{
|
{
|
||||||
context_release(context);
|
context_release(context);
|
||||||
WARN("Invalid context, skipping clear.\n");
|
WARN("Invalid context, skipping clear.\n");
|
||||||
return WINED3D_OK;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
|
@ -702,7 +702,7 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
|
||||||
{
|
{
|
||||||
context_release(context);
|
context_release(context);
|
||||||
WARN("Failed to apply clear state, skipping clear.\n");
|
WARN("Failed to apply clear state, skipping clear.\n");
|
||||||
return WINED3D_OK;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ENTER_GL();
|
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. */
|
wglFlush(); /* Flush to ensure ordering across contexts. */
|
||||||
|
|
||||||
context_release(context);
|
context_release(context);
|
||||||
|
|
||||||
return WINED3D_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG CDECL wined3d_device_incref(struct wined3d_device *device)
|
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);
|
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,
|
return WINED3D_OK;
|
||||||
&device->fb, rect_count, rects,
|
|
||||||
&draw_rect, flags, color, depth, stencil);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
|
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};
|
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
|
||||||
struct wined3d_fb_state fb = {&dst_surface, NULL};
|
struct wined3d_fb_state fb = {&dst_surface, NULL};
|
||||||
|
|
||||||
return device_clear_render_targets(device, 1, &fb,
|
device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
|
||||||
1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
|
|
||||||
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do not call while under the GL lock. */
|
/* 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};
|
const RECT draw_rect = {0, 0, surface->resource.width, surface->resource.height};
|
||||||
struct wined3d_fb_state fb = {NULL, surface};
|
struct wined3d_fb_state fb = {NULL, surface};
|
||||||
|
|
||||||
return device_clear_render_targets(device, 0, &fb,
|
device_clear_render_targets(device, 0, &fb, 1, rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0);
|
||||||
1, rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0);
|
|
||||||
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct blit_shader ffp_blit = {
|
const struct blit_shader ffp_blit = {
|
||||||
|
|
|
@ -1788,7 +1788,7 @@ struct wined3d_device
|
||||||
struct list patches[PATCHMAP_SIZE];
|
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,
|
UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags,
|
||||||
const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
|
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;
|
BOOL device_context_add(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue