=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Use renderbuffers when resolving multisample textures with conversion.
Alexandre Julliard
julliard at winehq.org
Fri Feb 16 13:41:31 CST 2018
Module: wine
Branch: master
Commit: de9ebcff70a41d1600c26734b3b0f2b3935992d2
URL: https://source.winehq.org/git/wine.git/?a=commit;h=de9ebcff70a41d1600c26734b3b0f2b3935992d2
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Fri Feb 16 15:13:33 2018 +0100
wined3d: Use renderbuffers when resolving multisample textures with conversion.
Direct3D 9 allows blits from multisample resources to non-multisample
resources with scaling or format conversion. In OpenGL, we resolve
multisample texture to the renderbuffer associated with the texture
before doing the actual blit with scaling/format conversion.
Signed-off-by: Józef Kucia <jkucia 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 | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1f5a98a..5cb9cda 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -350,6 +350,15 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
context_release(context);
}
+static BOOL is_multisample_location(const struct wined3d_texture *texture, DWORD location)
+{
+ if (location == WINED3D_LOCATION_RB_MULTISAMPLE)
+ return TRUE;
+ if (location != WINED3D_LOCATION_TEXTURE_RGB && location != WINED3D_LOCATION_TEXTURE_SRGB)
+ return FALSE;
+ return texture->target == GL_TEXTURE_2D_MULTISAMPLE || texture->target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
+}
+
/* Blit between surface locations. Onscreen on different swapchains is not supported.
* Depth / stencil is not supported. Context activation is done by the caller. */
static void surface_blt_fbo(const struct wined3d_device *device,
@@ -392,7 +401,7 @@ static void surface_blt_fbo(const struct wined3d_device *device,
}
/* Resolve the source surface first if needed. */
- if (src_location == WINED3D_LOCATION_RB_MULTISAMPLE
+ if (is_multisample_location(src_texture, src_location)
&& (src_texture->resource.format->id != dst_texture->resource.format->id
|| abs(src_rect.bottom - src_rect.top) != abs(dst_rect.bottom - dst_rect.top)
|| abs(src_rect.right - src_rect.left) != abs(dst_rect.right - dst_rect.left)))
More information about the wine-cvs
mailing list