Henri Verbeet : wined3d: device_clear_render_targets() never fails.

Alexandre Julliard julliard at winehq.org
Mon Apr 16 13:35:45 CDT 2012


Module: wine
Branch: master
Commit: 49c4623b2fba96aa18f6146fb58783efc868ee14
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=49c4623b2fba96aa18f6146fb58783efc868ee14

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun Apr 15 18:57:14 2012 +0200

wined3d: device_clear_render_targets() never fails.

---

 dlls/wined3d/device.c          |   14 ++++++--------
 dlls/wined3d/surface.c         |   10 ++++++----
 dlls/wined3d/wined3d_private.h |    2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a6443e5..ad30afa 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -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,
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 76f5863..a80cab2 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -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 =  {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index bf99835..0a110f8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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;




More information about the wine-cvs mailing list