Module: wine Branch: master Commit: b2e1b5968cc85c12549e75d5852f5e28e669a38a URL: http://source.winehq.org/git/wine.git/?a=commit;h=b2e1b5968cc85c12549e75d585...
Author: Matteo Bruni mbruni@codeweavers.com Date: Thu Oct 22 00:20:56 2015 +0200
wined3d: Allow FBO blits for depth formats with swizzle fixups.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/surface.c | 15 ++++++++++----- dlls/wined3d/wined3d_private.h | 5 +++++ 2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 320f269..d08259d 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1008,6 +1008,10 @@ static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined if (!((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) || (dst_usage & WINED3DUSAGE_RENDERTARGET))) return FALSE; + if (!(src_format->id == dst_format->id + || (is_identity_fixup(src_format->color_fixup) + && is_identity_fixup(dst_format->color_fixup)))) + return FALSE; break;
case WINED3D_BLIT_OP_DEPTH_BLIT: @@ -1015,17 +1019,18 @@ static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined return FALSE; if (!(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))) return FALSE; + /* Accept pure swizzle fixups for depth formats. In general we + * ignore the stencil component (if present) at the moment and the + * swizzle is not relevant with just the depth component. */ + if (is_complex_fixup(src_format->color_fixup) || is_complex_fixup(dst_format->color_fixup) + || is_scaling_fixup(src_format->color_fixup) || is_scaling_fixup(dst_format->color_fixup)) + return FALSE; break;
default: return FALSE; }
- if (!(src_format->id == dst_format->id - || (is_identity_fixup(src_format->color_fixup) - && is_identity_fixup(dst_format->color_fixup)))) - return FALSE; - return TRUE; }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d75169c..d30b59d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -145,6 +145,11 @@ static inline BOOL is_complex_fixup(struct color_fixup_desc fixup) return fixup.x_source == CHANNEL_SOURCE_COMPLEX0 || fixup.x_source == CHANNEL_SOURCE_COMPLEX1; }
+static inline BOOL is_scaling_fixup(struct color_fixup_desc fixup) +{ + return fixup.x_sign_fixup || fixup.y_sign_fixup || fixup.z_sign_fixup || fixup.w_sign_fixup; +} + static inline BOOL is_same_fixup(struct color_fixup_desc f1, struct color_fixup_desc f2) { return f1.x_sign_fixup == f2.x_sign_fixup && f1.x_source == f2.x_source