Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/surface.c | 5 ++--- dlls/wined3d/texture.c | 12 +++++++++++- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index a43f0f2f2c2..d254e904f8b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2522,9 +2522,8 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ TRACE("Not doing download because of format conversion.\n"); else if (src_texture->resource.format->conv_byte_count) TRACE("Not doing download because the source format needs conversion.\n"); - else if (wined3d_texture_gl_is_multisample_location(wined3d_texture_gl(src_texture), - WINED3D_LOCATION_TEXTURE_RGB)) - TRACE("Not doing download because of multisample source.\n"); + else if (!(src_texture->flags & WINED3D_TEXTURE_DOWNLOADABLE)) + TRACE("Not doing download because texture is not downloadable.\n"); else if (!texture2d_is_full_rect(src_texture, src_sub_resource_idx % src_texture->level_count, &src_rect)) TRACE("Not doing download because of partial download (src).\n"); else if (!texture2d_is_full_rect(dst_texture, dst_sub_resource_idx % dst_texture->level_count, &dst_rect)) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 1f9e5817699..380aff5016f 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1602,9 +1602,15 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT if (texture->texture_ops == &texture_gl_ops) { if (multisample_type && gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) + { wined3d_texture_gl(texture)->target = GL_TEXTURE_2D_MULTISAMPLE; + texture->flags &= ~WINED3D_TEXTURE_DOWNLOADABLE; + } else + { wined3d_texture_gl(texture)->target = GL_TEXTURE_2D; + texture->flags |= WINED3D_TEXTURE_DOWNLOADABLE; + } }
if (((width & (width - 1)) || (height & (height - 1))) && !d3d_info->texture_npot @@ -3223,7 +3229,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc texture->layer_count = layer_count; texture->level_count = level_count; texture->lod = 0; - texture->flags |= WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS; + texture->flags |= WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS + | WINED3D_TEXTURE_DOWNLOADABLE; if (flags & WINED3D_TEXTURE_CREATE_GET_DC_LENIENT) texture->flags |= WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_GET_DC_LENIENT; if (flags & (WINED3D_TEXTURE_CREATE_GET_DC | WINED3D_TEXTURE_CREATE_GET_DC_LENIENT)) @@ -3658,6 +3665,9 @@ HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, struct wi if (texture_gl->t.resource.gl_type == WINED3D_GL_RES_TYPE_TEX_RECT) texture_gl->target = GL_TEXTURE_RECTANGLE_ARB;
+ if (texture_gl->target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY || texture_gl->target == GL_TEXTURE_2D_MULTISAMPLE) + texture_gl->t.flags &= ~WINED3D_TEXTURE_DOWNLOADABLE; + return WINED3D_OK; }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index dde334cbdbb..71e4d712314 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3506,6 +3506,7 @@ struct wined3d_texture_ops #define WINED3D_TEXTURE_DISCARD 0x00002000 #define WINED3D_TEXTURE_GET_DC 0x00004000 #define WINED3D_TEXTURE_GENERATE_MIPMAPS 0x00008000 +#define WINED3D_TEXTURE_DOWNLOADABLE 0x00010000
#define WINED3D_TEXTURE_ASYNC_COLOR_KEY 0x00000001