Matteo Bruni : wined3d: Disable YUV formats when not supported.
Alexandre Julliard
julliard at winehq.org
Wed Sep 13 14:47:03 CDT 2017
Module: wine
Branch: master
Commit: 27f1d5ae8e07e0b0a0e43f1609f3b2a960b20b64
URL: http://source.winehq.org/git/wine.git/?a=commit;h=27f1d5ae8e07e0b0a0e43f1609f3b2a960b20b64
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Tue Sep 12 21:22:28 2017 +0200
wined3d: Disable YUV formats when not supported.
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/utils.c | 43 ++++++++++++++++++++++++++++++++-----------
1 file changed, 32 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 4c878b6..0d54334 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3224,7 +3224,8 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_
0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_W, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE);
}
- if (!gl_info->supported[APPLE_YCBCR_422])
+ if (!gl_info->supported[APPLE_YCBCR_422] && gl_info->supported[ARB_FRAGMENT_PROGRAM]
+ && gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
{
idx = get_format_idx(WINED3DFMT_YUY2);
gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_YUY2);
@@ -3232,18 +3233,38 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_
idx = get_format_idx(WINED3DFMT_UYVY);
gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_UYVY);
}
+ else if (!gl_info->supported[APPLE_YCBCR_422] && (!gl_info->supported[ARB_FRAGMENT_PROGRAM]
+ || !gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]))
+ {
+ idx = get_format_idx(WINED3DFMT_YUY2);
+ gl_info->formats[idx].glInternal = 0;
+
+ idx = get_format_idx(WINED3DFMT_UYVY);
+ gl_info->formats[idx].glInternal = 0;
+ }
- idx = get_format_idx(WINED3DFMT_YV12);
- format_set_flag(&gl_info->formats[idx], WINED3DFMT_FLAG_HEIGHT_SCALE);
- gl_info->formats[idx].height_scale.numerator = 3;
- gl_info->formats[idx].height_scale.denominator = 2;
- gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_YV12);
+ if (gl_info->supported[ARB_FRAGMENT_PROGRAM] && gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
+ {
+ idx = get_format_idx(WINED3DFMT_YV12);
+ format_set_flag(&gl_info->formats[idx], WINED3DFMT_FLAG_HEIGHT_SCALE);
+ gl_info->formats[idx].height_scale.numerator = 3;
+ gl_info->formats[idx].height_scale.denominator = 2;
+ gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_YV12);
- idx = get_format_idx(WINED3DFMT_NV12);
- format_set_flag(&gl_info->formats[idx], WINED3DFMT_FLAG_HEIGHT_SCALE);
- gl_info->formats[idx].height_scale.numerator = 3;
- gl_info->formats[idx].height_scale.denominator = 2;
- gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_NV12);
+ idx = get_format_idx(WINED3DFMT_NV12);
+ format_set_flag(&gl_info->formats[idx], WINED3DFMT_FLAG_HEIGHT_SCALE);
+ gl_info->formats[idx].height_scale.numerator = 3;
+ gl_info->formats[idx].height_scale.denominator = 2;
+ gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_NV12);
+ }
+ else
+ {
+ idx = get_format_idx(WINED3DFMT_YV12);
+ gl_info->formats[idx].glInternal = 0;
+
+ idx = get_format_idx(WINED3DFMT_NV12);
+ gl_info->formats[idx].glInternal = 0;
+ }
if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
{
More information about the wine-cvs
mailing list