Henri Verbeet : wined3d: Get rid of the "onscreen_depth_stencil" field from struct wined3d_device.

Alexandre Julliard julliard at winehq.org
Thu Jan 26 14:53:14 CST 2017


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Jan 26 13:25:20 2017 +0100

wined3d: Get rid of the "onscreen_depth_stencil" field from struct wined3d_device.

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

---

 dlls/wined3d/cs.c              |  5 -----
 dlls/wined3d/device.c          | 31 -------------------------------
 dlls/wined3d/drawprim.c        |  5 -----
 dlls/wined3d/swapchain.c       |  7 -------
 dlls/wined3d/wined3d_private.h |  3 ---
 5 files changed, 51 deletions(-)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 6a366b8..c030d35 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -634,11 +634,6 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
         {
             wined3d_texture_validate_location(prev_surface->container,
                     prev->sub_resource_idx, WINED3D_LOCATION_DISCARDED);
-            if (prev_surface == device->onscreen_depth_stencil)
-            {
-                wined3d_texture_decref(device->onscreen_depth_stencil->container);
-                device->onscreen_depth_stencil = NULL;
-            }
         }
     }
 
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 10c5df1..75a939e 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -198,20 +198,6 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context
     device->contexts = new_array;
 }
 
-void device_switch_onscreen_ds(struct wined3d_device *device,
-        struct wined3d_context *context, struct wined3d_surface *depth_stencil)
-{
-    if (device->onscreen_depth_stencil)
-    {
-        surface_load_location(device->onscreen_depth_stencil, context, WINED3D_LOCATION_TEXTURE_RGB);
-        wined3d_texture_invalidate_location(device->onscreen_depth_stencil->container,
-                surface_get_sub_resource_idx(device->onscreen_depth_stencil), ~WINED3D_LOCATION_TEXTURE_RGB);
-        wined3d_texture_decref(device->onscreen_depth_stencil->container);
-    }
-    device->onscreen_depth_stencil = depth_stencil;
-    wined3d_texture_incref(device->onscreen_depth_stencil->container);
-}
-
 static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect)
 {
     unsigned int height = wined3d_texture_get_level_height(target->container, target->texture_level);
@@ -300,8 +286,6 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
     {
         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);
         surface_load_location(depth_stencil, context, location);
     }
 
@@ -1086,7 +1070,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
     struct wined3d_resource *resource, *cursor;
     const struct wined3d_gl_info *gl_info;
     struct wined3d_context *context;
-    struct wined3d_surface *surface;
     UINT i;
 
     TRACE("device %p.\n", device);
@@ -1133,14 +1116,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
 
     context_release(context);
 
-    /* Release the buffers (with sanity checks) */
-    if (device->onscreen_depth_stencil)
-    {
-        surface = device->onscreen_depth_stencil;
-        device->onscreen_depth_stencil = NULL;
-        wined3d_texture_decref(surface->container);
-    }
-
     if (device->fb.depth_stencil)
     {
         struct wined3d_rendertarget_view *view = device->fb.depth_stencil;
@@ -4636,12 +4611,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
     }
     wined3d_device_set_depth_stencil_view(device, NULL);
 
-    if (device->onscreen_depth_stencil)
-    {
-        wined3d_texture_decref(device->onscreen_depth_stencil->container);
-        device->onscreen_depth_stencil = NULL;
-    }
-
     if (reset_state)
     {
         LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index ddeb238..a3d88b9 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -466,12 +466,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
         struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(dsv);
 
         if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
-        {
-            if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
-                device_switch_onscreen_ds(device, context, ds);
-
             wined3d_texture_load_location(ds->container, dsv->sub_resource_idx, context, location);
-        }
         else
             wined3d_texture_prepare_location(ds->container, dsv->sub_resource_idx, context, location);
     }
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 30f6c7d..62589c1 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -621,15 +621,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
 
         if (ds && (swapchain->desc.flags & WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
                 || ds->container->flags & WINED3D_TEXTURE_DISCARD))
-        {
             wined3d_texture_validate_location(ds->container,
                     fb->depth_stencil->sub_resource_idx, WINED3D_LOCATION_DISCARDED);
-            if (ds == swapchain->device->onscreen_depth_stencil)
-            {
-                wined3d_texture_decref(swapchain->device->onscreen_depth_stencil->container);
-                swapchain->device->onscreen_depth_stencil = NULL;
-            }
-        }
     }
 
     context_release(context);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 338aef0..9f061bf 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2560,7 +2560,6 @@ struct wined3d_device
 
     /* Render Target Support */
     struct wined3d_fb_state fb;
-    struct wined3d_surface *onscreen_depth_stencil;
     struct wined3d_rendertarget_view *auto_depth_stencil_view;
 
     /* For rendering to a texture using glCopyTexImage */
@@ -2612,8 +2611,6 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
         UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN;
 void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
 void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
-void device_switch_onscreen_ds(struct wined3d_device *device, struct wined3d_context *context,
-        struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN;
 void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
 
 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)




More information about the wine-cvs mailing list