[PATCH 1/5] wined3d: Restore support for d3d9 "fake" formats.

Matteo Bruni mbruni at codeweavers.com
Tue Sep 5 18:39:15 CDT 2017


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
This probably regressed with commit
8c98be4791f18f31b04a4a0f08d18979aa0d06df.

 dlls/wined3d/directx.c         | 7 +++++++
 dlls/wined3d/utils.c           | 4 ++++
 dlls/wined3d/wined3d_private.h | 1 +
 3 files changed, 12 insertions(+)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index e30430a606..f010ca32f1 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5220,6 +5220,13 @@ static BOOL wined3d_check_surface_capability(const struct wined3d_format *format
         return TRUE;
     }
 
+    if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_FAKE | WINED3DFMT_FLAG_TEXTURE))
+            == (WINED3DFMT_FLAG_FAKE | WINED3DFMT_FLAG_TEXTURE))
+    {
+        TRACE("[OK]\n");
+        return TRUE;
+    }
+
     /* Reject other formats */
     TRACE("[FAILED]\n");
     return FALSE;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 1c646064bc..f60282c996 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -333,6 +333,10 @@ static const struct wined3d_format_base_flags format_base_flags[] =
     {WINED3DFMT_D32_FLOAT,            WINED3DFMT_FLAG_FLOAT},
     {WINED3DFMT_S8_UINT_D24_FLOAT,    WINED3DFMT_FLAG_FLOAT},
     {WINED3DFMT_D32_FLOAT_S8X24_UINT, WINED3DFMT_FLAG_FLOAT},
+    {WINED3DFMT_INST,                 WINED3DFMT_FLAG_FAKE},
+    {WINED3DFMT_NULL,                 WINED3DFMT_FLAG_FAKE},
+    {WINED3DFMT_NVDB,                 WINED3DFMT_FLAG_FAKE},
+    {WINED3DFMT_RESZ,                 WINED3DFMT_FLAG_FAKE},
 };
 
 struct wined3d_format_block_info
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 1a196a5997..28560d4693 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4114,6 +4114,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
 #define WINED3DFMT_FLAG_DEPTH                       0x00000004
 #define WINED3DFMT_FLAG_STENCIL                     0x00000008
 #define WINED3DFMT_FLAG_RENDERTARGET                0x00000010
+#define WINED3DFMT_FLAG_FAKE                        0x00000020
 #define WINED3DFMT_FLAG_FBO_ATTACHABLE              0x00000040
 #define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB         0x00000080
 #define WINED3DFMT_FLAG_FLOAT                       0x00000200
-- 
2.13.5




More information about the wine-patches mailing list