[PATCH 4/6] wined3d: Disable YUV formats when fixups are not supported.
Matteo Bruni
mbruni at codeweavers.com
Sun May 7 13:32:36 CDT 2017
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
That includes core profile at the moment.
dlls/wined3d/directx.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 521a0a5..f1dc99e 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5156,7 +5156,8 @@ static BOOL CheckRenderTargetCapability(const struct wined3d_adapter *adapter,
return FALSE;
}
-static BOOL wined3d_check_surface_capability(const struct wined3d_format *format, BOOL no3d)
+static BOOL wined3d_check_surface_capability(const struct wined3d_format *format,
+ const struct wined3d_gl_info *gl_info, BOOL no3d)
{
if (no3d)
{
@@ -5192,8 +5193,19 @@ static BOOL wined3d_check_surface_capability(const struct wined3d_format *format
if (format->glInternal)
{
- TRACE("[OK]\n");
- return TRUE;
+ switch (format->id)
+ {
+ case WINED3DFMT_YUY2:
+ case WINED3DFMT_UYVY:
+ case WINED3DFMT_YV12:
+ case WINED3DFMT_NV12:
+ TRACE("%s\n", gl_info->supported[ARB_FRAGMENT_PROGRAM]
+ ? "[OK]" : "[FAILED] - No YUV fixups support.");
+ return gl_info->supported[ARB_FRAGMENT_PROGRAM];
+ default:
+ TRACE("[OK]\n");
+ return TRUE;
+ }
}
/* Reject other formats */
@@ -5241,7 +5253,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
allowed_usage |= WINED3DUSAGE_QUERY_SRGBWRITE;
if (!(usage & WINED3DUSAGE_TEXTURE))
{
- if (!wined3d_check_surface_capability(format, wined3d->flags & WINED3D_NO3D))
+ if (!wined3d_check_surface_capability(format, gl_info, wined3d->flags & WINED3D_NO3D))
{
TRACE("[FAILED] - Not supported for plain surfaces.\n");
return WINED3DERR_NOTAVAILABLE;
--
2.10.2
More information about the wine-patches
mailing list