Jan Sikorski : wined3d: Pass format id for typeless resolve through wined3d_blt_fx.

Alexandre Julliard julliard at winehq.org
Wed Mar 31 15:55:14 CDT 2021


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

Author: Jan Sikorski <jsikorski at codeweavers.com>
Date:   Wed Mar 31 12:27:36 2021 +0200

wined3d: Pass format id for typeless resolve through wined3d_blt_fx.

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

---

 dlls/ddraw/surface.c   | 2 +-
 dlls/wined3d/device.c  | 5 ++++-
 dlls/wined3d/surface.c | 1 +
 include/wine/wined3d.h | 1 +
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 08e3811436d..6af1fce825f 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -1686,7 +1686,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface1_Blt(IDirectDrawSurface *i
 {
     struct ddraw_surface *dst_impl = impl_from_IDirectDrawSurface(iface);
     struct ddraw_surface *src_impl = unsafe_impl_from_IDirectDrawSurface(src_surface);
-    struct wined3d_blt_fx wined3d_fx;
+    struct wined3d_blt_fx wined3d_fx = {0};
     DWORD unsupported_flags;
     DWORD fill_colour = 0;
     HRESULT hr = DD_OK;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 71ca6740c37..ea5f6259b7e 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5166,6 +5166,7 @@ void CDECL wined3d_device_resolve_sub_resource(struct wined3d_device *device,
 {
     struct wined3d_texture *dst_texture, *src_texture;
     unsigned int dst_level, src_level;
+    struct wined3d_blt_fx fx = {0};
     RECT dst_rect, src_rect;
 
     TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, "
@@ -5192,6 +5193,8 @@ void CDECL wined3d_device_resolve_sub_resource(struct wined3d_device *device,
         return;
     }
 
+    fx.resolve_format_id = format_id;
+
     dst_texture = texture_from_resource(dst_resource);
     src_texture = texture_from_resource(src_resource);
 
@@ -5202,7 +5205,7 @@ void CDECL wined3d_device_resolve_sub_resource(struct wined3d_device *device,
     SetRect(&src_rect, 0, 0, wined3d_texture_get_level_width(src_texture, src_level),
             wined3d_texture_get_level_height(src_texture, src_level));
     wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect,
-            src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT);
+            src_texture, src_sub_resource_idx, &src_rect, 0, &fx, WINED3D_TEXF_POINT);
 }
 
 HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index d5d07d8c401..855f739c9df 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1509,6 +1509,7 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
         TRACE("src_color_key {0x%08x, 0x%08x}.\n",
                 fx->src_color_key.color_space_low_value,
                 fx->src_color_key.color_space_high_value);
+        TRACE("resolve_format_id %s.\n", debug_d3dformat(fx->resolve_format_id));
     }
 
     dst_sub_resource = &dst_texture->sub_resources[dst_sub_resource_idx];
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 197a56d1952..b1b435602bb 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2014,6 +2014,7 @@ struct wined3d_blt_fx
     DWORD fx;
     struct wined3d_color_key dst_color_key;
     struct wined3d_color_key src_color_key;
+    enum wined3d_format_id resolve_format_id;
 };
 
 struct wined3d_buffer_desc




More information about the wine-cvs mailing list