From: Paul Gofman gofmanp@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41929 Signed-off-by: Paul Gofman gofmanp@gmail.com
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- This supersedes patch 180866.
dlls/d3d9/tests/visual.c | 26 +++++++++++++------------- dlls/wined3d/surface.c | 18 ++++-------------- dlls/wined3d/texture.c | 4 ++++ 3 files changed, 21 insertions(+), 27 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index a798d975f91..9ceb758c605 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -3917,24 +3917,24 @@ static void stretchrect_test(void) {BACKBUFFER, &src_rect, TEX_RT_DST_640_480, &dst_rect_flipy, D3DTEXF_NONE}, /* Test filter. */ {OFFSCREEN_64, NULL, OFFSCREEN_DST_64, NULL, D3DTEXF_NONE, TRUE}, - {OFFSCREEN_64, NULL, OFFSCREEN_DST_64, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, + {OFFSCREEN_64, NULL, OFFSCREEN_DST_64, NULL, D3DTEXF_ANISOTROPIC}, {OFFSCREEN_32, NULL, TEX_RT_DST_64, NULL, D3DTEXF_NONE, TRUE}, - {OFFSCREEN_32, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, - {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, - {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_PYRAMIDALQUAD, FALSE, TRUE}, - {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_GAUSSIANQUAD, FALSE, TRUE}, - {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, - {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_CONVOLUTIONMONO, FALSE, TRUE}, - {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, 0xbadf, FALSE, TRUE}, + {OFFSCREEN_32, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC}, + {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC}, + {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_PYRAMIDALQUAD}, + {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_GAUSSIANQUAD}, + {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC}, + {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_CONVOLUTIONMONO}, + {OFFSCREEN_64, NULL, TEX_RT_DST_64, NULL, 0xbadf}, {TEX_64, NULL, RT_DST_64, NULL, D3DTEXF_NONE, TRUE}, - {TEX_64, NULL, RT_DST_64, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, - {RT_64, NULL, RT_DST_64, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, + {TEX_64, NULL, RT_DST_64, NULL, D3DTEXF_ANISOTROPIC}, + {RT_64, NULL, RT_DST_64, NULL, D3DTEXF_ANISOTROPIC}, {TEX_RT_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_NONE, TRUE}, - {TEX_RT_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, + {TEX_RT_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC}, {RT_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_NONE, TRUE}, - {RT_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, + {RT_64, NULL, TEX_RT_DST_64, NULL, D3DTEXF_ANISOTROPIC}, {BACKBUFFER, NULL, TEX_RT_DST_640_480, NULL, D3DTEXF_NONE, TRUE}, - {BACKBUFFER, NULL, TEX_RT_DST_640_480, NULL, D3DTEXF_ANISOTROPIC, FALSE, TRUE}, + {BACKBUFFER, NULL, TEX_RT_DST_640_480, NULL, D3DTEXF_ANISOTROPIC}, };
window = create_window(); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 3745d8dde7f..e965203950e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -165,20 +165,10 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co && (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));
- switch (filter) - { - case WINED3D_TEXF_LINEAR: - gl_filter = scaled_resolve ? GL_SCALED_RESOLVE_NICEST_EXT : GL_LINEAR; - break; - - default: - FIXME("Unsupported filter mode %s (%#x).\n", debug_d3dtexturefiltertype(filter), filter); - /* fall through */ - case WINED3D_TEXF_NONE: - case WINED3D_TEXF_POINT: - gl_filter = scaled_resolve ? GL_SCALED_RESOLVE_FASTEST_EXT : GL_NEAREST; - break; - } + if (filter == WINED3D_TEXF_LINEAR) + gl_filter = scaled_resolve ? GL_SCALED_RESOLVE_NICEST_EXT : GL_LINEAR; + else + gl_filter = scaled_resolve ? GL_SCALED_RESOLVE_FASTEST_EXT : GL_NEAREST;
/* Make sure the locations are up-to-date. Loading the destination * surface isn't required if the entire surface is overwritten. (And is diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index b663a44fbb1..85f09ee3489 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3569,6 +3569,10 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned || src_texture->resource.type != WINED3D_RTYPE_TEXTURE_2D) return WINED3DERR_INVALIDCALL;
+ if (filter != WINED3D_TEXF_NONE && filter != WINED3D_TEXF_POINT + && filter != WINED3D_TEXF_LINEAR) + return WINED3DERR_INVALIDCALL; + dst_format_flags = dst_texture->resource.format_flags; if (FAILED(hr = wined3d_texture_check_box_dimensions(dst_texture, dst_sub_resource_idx % dst_texture->level_count, &dst_box)))