Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/wined3d/adapter_gl.c | 2 ++ dlls/wined3d/surface.c | 15 +++++++++++---- dlls/wined3d/wined3d_gl.h | 1 + 3 files changed, 14 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..8b37286cbe 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -149,6 +149,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co struct wined3d_texture *required_texture, *restore_texture; const struct wined3d_gl_info *gl_info; struct wined3d_context_gl *context_gl; + BOOL is_source_multisampled; unsigned int restore_idx; GLenum gl_filter; GLenum buffer; @@ -160,10 +161,13 @@ 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));
+ is_source_multisampled = wined3d_texture_gl_is_multisample_location(wined3d_texture_gl(src_texture), + src_location); + switch (filter) { case WINED3D_TEXF_LINEAR: - gl_filter = GL_LINEAR; + gl_filter = is_source_multisampled ? GL_SCALED_RESOLVE_NICEST_EXT : GL_LINEAR; break;
default: @@ -171,7 +175,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 = is_source_multisampled ? GL_SCALED_RESOLVE_FASTEST_EXT : GL_NEAREST; break; }
@@ -896,6 +900,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 +925,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 +951,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,