Henri Verbeet : wined3d: Get resource info from the texture in surface_blt_special().

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 23 11:21:01 CDT 2016


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Mar 22 17:46:11 2016 +0100

wined3d: Get resource info from the texture in surface_blt_special().

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

---

 dlls/wined3d/surface.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 4243de6..9840683 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2621,35 +2621,39 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
         struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
         const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
 {
-    struct wined3d_device *device = dst_surface->resource.device;
+    struct wined3d_texture *dst_texture = dst_surface->container;
+    struct wined3d_device *device = dst_texture->resource.device;
     const struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(device->fb.render_targets[0]);
     struct wined3d_swapchain *src_swapchain, *dst_swapchain;
+    struct wined3d_texture *src_texture;
 
     TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n",
             dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect),
             flags, fx, debug_d3dtexturefiltertype(filter));
 
     /* Get the swapchain. One of the surfaces has to be a primary surface */
-    if (dst_surface->resource.pool == WINED3D_POOL_SYSTEM_MEM)
+    if (dst_texture->resource.pool == WINED3D_POOL_SYSTEM_MEM)
     {
         WARN("Destination is in sysmem, rejecting gl blt\n");
         return WINED3DERR_INVALIDCALL;
     }
 
-    dst_swapchain = dst_surface->container->swapchain;
+    dst_swapchain = dst_texture->swapchain;
 
     if (src_surface)
     {
-        if (src_surface->resource.pool == WINED3D_POOL_SYSTEM_MEM)
+        src_texture = src_surface->container;
+        if (src_texture->resource.pool == WINED3D_POOL_SYSTEM_MEM)
         {
             WARN("Src is in sysmem, rejecting gl blt\n");
             return WINED3DERR_INVALIDCALL;
         }
 
-        src_swapchain = src_surface->container->swapchain;
+        src_swapchain = src_texture->swapchain;
     }
     else
     {
+        src_texture = NULL;
         src_swapchain = NULL;
     }
 
@@ -2698,8 +2702,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
         BOOL stretchx;
 
         /* P8 read back is not implemented */
-        if (src_surface->resource.format->id == WINED3DFMT_P8_UINT
-                || dst_surface->resource.format->id == WINED3DFMT_P8_UINT)
+        if (src_texture->resource.format->id == WINED3DFMT_P8_UINT
+                || dst_texture->resource.format->id == WINED3DFMT_P8_UINT)
         {
             TRACE("P8 read back not supported by frame buffer to texture blit\n");
             return WINED3DERR_INVALIDCALL;




More information about the wine-cvs mailing list