Commit b2e1b596 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Allow FBO blits for depth formats with swizzle fixups.

parent 1745c5f9
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment