Signed-off-by: Paul Gofman gofmanp@gmail.com --- v3: - don't use resolve filter in case of no scaling in texture2d_blt_fbo().
dlls/wined3d/adapter_gl.c | 2 ++ dlls/wined3d/surface.c | 16 ++++++++++++---- dlls/wined3d/wined3d_gl.h | 1 + 3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 6e60c5323e..ee091a9b77 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -206,6 +206,8 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_EXT_texture_snorm", EXT_TEXTURE_SNORM }, {"GL_EXT_texture_sRGB", EXT_TEXTURE_SRGB }, {"GL_EXT_texture_sRGB_decode", EXT_TEXTURE_SRGB_DECODE }, + {"GL_EXT_framebuffer_multisample_blit_scaled", + EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED}, {"GL_EXT_texture_swizzle", ARB_TEXTURE_SWIZZLE }, {"GL_EXT_vertex_array_bgra", ARB_VERTEX_ARRAY_BGRA },
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 1e47f47841..d12a320fef 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -150,6 +150,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co const struct wined3d_gl_info *gl_info; struct wined3d_context_gl *context_gl; unsigned int restore_idx; + BOOL use_resolve_filter; GLenum gl_filter; GLenum buffer; RECT s, d; @@ -160,10 +161,14 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co wined3d_debug_location(src_location), wine_dbgstr_rect(src_rect), dst_texture, dst_sub_resource_idx, wined3d_debug_location(dst_location), wine_dbgstr_rect(dst_rect));
+ use_resolve_filter = wined3d_texture_gl_is_multisample_location(wined3d_texture_gl(src_texture), + src_location) && (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 = GL_LINEAR; + gl_filter = use_resolve_filter ? GL_SCALED_RESOLVE_NICEST_EXT : GL_LINEAR; break;
default: @@ -171,7 +176,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co /* fall through */ case WINED3D_TEXF_NONE: case WINED3D_TEXF_POINT: - gl_filter = GL_NEAREST; + gl_filter = use_resolve_filter ? GL_SCALED_RESOLVE_FASTEST_EXT : GL_NEAREST; break; }
@@ -896,6 +901,7 @@ static DWORD fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter) { struct wined3d_context_gl *context_gl = wined3d_context_gl(context); + const struct wined3d_gl_info *gl_info = context_gl->gl_info; struct wined3d_resource *src_resource, *dst_resource; enum wined3d_blit_op blit_op = op; struct wined3d_device *device; @@ -920,7 +926,7 @@ static DWORD fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit blit_op = WINED3D_BLIT_OP_COLOR_BLIT; }
- if (!fbo_blitter_supported(blit_op, context_gl->gl_info, + if (!fbo_blitter_supported(blit_op, gl_info, src_resource, src_location, dst_resource, dst_location)) { if (!(next = blitter->next)) @@ -946,7 +952,9 @@ static DWORD fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit if (wined3d_texture_gl_is_multisample_location(wined3d_texture_gl(dst_texture), dst_location)) dst_location = WINED3D_LOCATION_RB_RESOLVED;
- if (wined3d_texture_gl_is_multisample_location(wined3d_texture_gl(src_texture), src_location)) + if (wined3d_texture_gl_is_multisample_location(wined3d_texture_gl(src_texture), src_location) + && (src_texture->resource.format->id != dst_texture->resource.format->id + || !gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED])) src_location = WINED3D_LOCATION_RB_RESOLVED; }
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 3372b4b6be..2d838d7f84 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -185,6 +185,7 @@ enum wined3d_gl_extension EXT_TEXTURE_SNORM, EXT_TEXTURE_SRGB, EXT_TEXTURE_SRGB_DECODE, + EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED, /* NVIDIA */ NV_FENCE, NV_FOG_DISTANCE,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=66840
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/wined3d/surface.c:946 Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/wined3d/surface.c:946 Task: Patch failed to apply