=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Support loading renderbuffers in surface_load_location.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 23 09:59:46 CST 2015


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun Nov 22 01:00:58 2015 +0100

wined3d: Support loading renderbuffers in surface_load_location.

Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0a7112c..6a93de4 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4084,16 +4084,23 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
 }
 
 /* Context activation is done by the caller. */
-static void surface_multisample_resolve(struct wined3d_surface *surface, struct wined3d_context *context)
+static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wined3d_context *context,
+        DWORD dst_location)
 {
-    RECT rect = {0, 0, surface->resource.width, surface->resource.height};
+    const RECT rect = {0, 0, surface->resource.width, surface->resource.height};
+    DWORD src_location;
 
-    if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE))
-        ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
-                surface);
+    if (surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)
+        src_location = WINED3D_LOCATION_RB_MULTISAMPLE;
+    else if (surface->locations & WINED3D_LOCATION_RB_RESOLVED)
+        src_location = WINED3D_LOCATION_RB_RESOLVED;
+    else if (surface->locations & WINED3D_LOCATION_TEXTURE_SRGB)
+        src_location = WINED3D_LOCATION_TEXTURE_SRGB;
+    else /* surface_blt_fbo will load the source location if necessary. */
+        src_location = WINED3D_LOCATION_TEXTURE_RGB;
 
     surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT,
-            surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
+            surface, src_location, &rect, surface, dst_location, &rect);
 }
 
 /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */
@@ -4161,7 +4168,8 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
             break;
 
         case WINED3D_LOCATION_RB_RESOLVED:
-            surface_multisample_resolve(surface, context);
+        case WINED3D_LOCATION_RB_MULTISAMPLE:
+            surface_load_renderbuffer(surface, context, location);
             break;
 
         case WINED3D_LOCATION_TEXTURE_RGB:




More information about the wine-cvs mailing list