=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Use wined3d_texture_prepare_location() in device_clear_render_targets().

Alexandre Julliard julliard at wine.codeweavers.com
Thu Apr 21 09:47:18 CDT 2016


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Apr 20 19:29:15 2016 +0200

wined3d: Use wined3d_texture_prepare_location() in device_clear_render_targets().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/device.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c44e911..ddd2d83 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -292,8 +292,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
         float depth, DWORD stencil)
 {
     struct wined3d_surface *target = rt_count ? wined3d_rendertarget_view_get_surface(fb->render_targets[0]) : NULL;
-    struct wined3d_surface *depth_stencil = fb->depth_stencil
-            ? wined3d_rendertarget_view_get_surface(fb->depth_stencil) : NULL;
+    struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
+    struct wined3d_surface *depth_stencil = dsv ? wined3d_rendertarget_view_get_surface(dsv) : NULL;
     const struct wined3d_state *state = &device->state;
     const struct wined3d_gl_info *gl_info;
     UINT drawable_width, drawable_height;
@@ -331,7 +331,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
             if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, rect_count ? clear_rect : NULL))
                 surface_load_location(rt, context, rtv->resource->draw_binding);
             else
-                wined3d_surface_prepare(rt, context, rtv->resource->draw_binding);
+                wined3d_texture_prepare_location(rt->container, rtv->sub_resource_idx,
+                        context, rtv->resource->draw_binding);
         }
     }
 
@@ -350,11 +351,12 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
     }
 
     if (depth_stencil && render_offscreen)
-        wined3d_surface_prepare(depth_stencil, context, depth_stencil->container->resource.draw_binding);
+        wined3d_texture_prepare_location(depth_stencil->container,
+                dsv->sub_resource_idx, context, dsv->resource->draw_binding);
 
     if (flags & WINED3DCLEAR_ZBUFFER)
     {
-        DWORD location = render_offscreen ? fb->depth_stencil->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
+        DWORD location = render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
 
         if (!render_offscreen && depth_stencil != device->onscreen_depth_stencil)
             device_switch_onscreen_ds(device, context, depth_stencil);
@@ -386,7 +388,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
 
     if (flags & WINED3DCLEAR_ZBUFFER)
     {
-        DWORD location = render_offscreen ? fb->depth_stencil->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
+        DWORD location = render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
 
         surface_modify_ds_location(depth_stencil, location, ds_rect.right, ds_rect.bottom);
 




More information about the wine-cvs mailing list