Henri Verbeet : wined3d: Use the view instead of the texture in is_full_clear().

Alexandre Julliard julliard at winehq.org
Mon Apr 27 15:19:30 CDT 2020


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Apr 27 20:36:45 2020 +0430

wined3d: Use the view instead of the texture in is_full_clear().

Using the texture is a left-over from when rendertargets were surfaces.
Using the view is in fact more straightforward.

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

---

 dlls/wined3d/texture.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 5b0b070998..70acc5b182 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -5176,14 +5176,10 @@ static bool ffp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3
     }
 }
 
-static bool is_full_clear(const struct wined3d_texture *texture, unsigned int sub_resource_idx,
-        const RECT *draw_rect, const RECT *clear_rect)
+static bool is_full_clear(const struct wined3d_rendertarget_view *rtv, const RECT *draw_rect, const RECT *clear_rect)
 {
-    unsigned int width, height, level;
-
-    level = sub_resource_idx % texture->level_count;
-    width = wined3d_texture_get_level_width(texture, level);
-    height = wined3d_texture_get_level_height(texture, level);
+    unsigned int height = rtv->height;
+    unsigned int width = rtv->width;
 
     /* partial draw rect */
     if (draw_rect->left || draw_rect->top || draw_rect->right < width || draw_rect->bottom < height)
@@ -5256,8 +5252,7 @@ static void ffp_blitter_clear_rendertargets(struct wined3d_device *device, unsig
         {
             struct wined3d_texture *rt = wined3d_texture_from_resource(rtv->resource);
 
-            if (flags & WINED3DCLEAR_TARGET && !is_full_clear(rt, rtv->sub_resource_idx,
-                    draw_rect, rect_count ? clear_rect : NULL))
+            if (flags & WINED3DCLEAR_TARGET && !is_full_clear(rtv, draw_rect, rect_count ? clear_rect : NULL))
                 wined3d_texture_load_location(rt, rtv->sub_resource_idx, context, rtv->resource->draw_binding);
             else
                 wined3d_texture_prepare_location(rt, rtv->sub_resource_idx, context, rtv->resource->draw_binding);
@@ -5284,7 +5279,7 @@ static void ffp_blitter_clear_rendertargets(struct wined3d_device *device, unsig
         struct wined3d_texture *ds = wined3d_texture_from_resource(dsv->resource);
 
         if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)
-                && !is_full_clear(ds, dsv->sub_resource_idx, draw_rect, rect_count ? clear_rect : NULL))
+                && !is_full_clear(dsv, draw_rect, rect_count ? clear_rect : NULL))
             wined3d_texture_load_location(ds, dsv->sub_resource_idx, context, ds_location);
         else
             wined3d_texture_prepare_location(ds, dsv->sub_resource_idx, context, ds_location);




More information about the wine-cvs mailing list