=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Add support for multisample textures in wined3d_texture_update_desc().

Alexandre Julliard julliard at winehq.org
Fri Feb 9 14:51:45 CST 2018


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Fri Feb  9 13:03:24 2018 +0100

wined3d: Add support for multisample textures in wined3d_texture_update_desc().

This might be called from wined3d_device_reset().

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/texture.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 5ff8a4f..750101f 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1347,9 +1347,9 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
         return WINED3DERR_INVALIDCALL;
     }
 
-    if (texture->resource.type == WINED3D_RTYPE_TEXTURE_3D)
+    if (texture->resource.type != WINED3D_RTYPE_TEXTURE_2D)
     {
-        WARN("Not supported on 3D textures.\n");
+        WARN("Not supported on %s.\n", debug_d3dresourcetype(texture->resource.type));
         return WINED3DERR_INVALIDCALL;
     }
 
@@ -1403,6 +1403,12 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
     sub_resource->size = texture->slice_pitch;
     sub_resource->locations = WINED3D_LOCATION_DISCARDED;
 
+    if (multisample_type && gl_info->supported[ARB_TEXTURE_MULTISAMPLE])
+        texture->target = GL_TEXTURE_2D_MULTISAMPLE;
+    else
+        texture->target = GL_TEXTURE_2D;
+    texture->sub_resources[0].u.surface->texture_target = texture->target;
+
     if (((width & (width - 1)) || (height & (height - 1))) && !gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]
             && !gl_info->supported[ARB_TEXTURE_RECTANGLE] && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT])
     {




More information about the wine-cvs mailing list