Stefan Dösinger : wined3d: Silence some format spam.

Alexandre Julliard julliard at winehq.org
Thu Aug 28 07:00:34 CDT 2008


Module: wine
Branch: master
Commit: ec4955630e9eebc2ac6706786d949f2f60279266
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ec4955630e9eebc2ac6706786d949f2f60279266

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Mon Aug 25 09:25:24 2008 -0500

wined3d: Silence some format spam.

---

 dlls/ddraw/ddraw.c           |    3 ++-
 dlls/wined3d/directx.c       |   14 ++++++++++++++
 dlls/wined3d/utils.c         |    7 ++++++-
 include/wine/wined3d_types.h |    2 ++
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 73982ed..436846c 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -880,8 +880,9 @@ IDirectDrawImpl_GetFourCCCodes(IDirectDraw7 *iface,
 {
     ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw7, iface);
     WINED3DFORMAT formats[] = {
-        WINED3DFMT_YUY2, WINED3DFMT_UYVY,
+        WINED3DFMT_YUY2, WINED3DFMT_UYVY, WINED3DFMT_YV12,
         WINED3DFMT_DXT1, WINED3DFMT_DXT2, WINED3DFMT_DXT3, WINED3DFMT_DXT4, WINED3DFMT_DXT5,
+        WINED3DFMT_ATI2N, WINED3DFMT_NVHU, WINED3DFMT_NVHS
     };
     DWORD count = 0, i, outsize;
     HRESULT hr;
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 53ea543..d269406 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2323,6 +2323,9 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE
             }
             TRACE_(d3d_caps)("[FAILED]\n");
             return FALSE;
+        case WINED3DFMT_YV12:
+            TRACE_(d3d_caps)("[FAILED]\n");
+            return FALSE;
 
             /* Not supported */
         case WINED3DFMT_A16B16G16R16:
@@ -2397,6 +2400,17 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE
             TRACE_(d3d_caps)("[FAILED]\n");
             return FALSE;
 
+        case WINED3DFMT_NVHU:
+        case WINED3DFMT_NVHS:
+            /* These formats seem to be similar to the HILO formats in GL_NV_texture_shader. NVHU
+             * is said to be GL_UNSIGNED_HILO16, NVHS GL_SIGNED_HILO16. Rumours say that d3d computes
+             * a 3rd channel similarly to D3DFMT_CxV8U8(So NVHS could be called D3DFMT_CxV16U16).
+             * ATI refused to support formats which can easilly be emulated with pixel shaders, so
+             * Applications have to deal with not having NVHS and NVHU.
+             */
+            TRACE_(d3d_caps)("[FAILED]\n");
+            return FALSE;
+
         case WINED3DFMT_UNKNOWN:
             return FALSE;
 
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 119f526..c0e1ccf 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -44,7 +44,7 @@ static const StaticPixelFormatDesc formats[] = {
     /* FourCC formats, kept here to have WINED3DFMT_R8G8B8(=20) at position 20 */
     {WINED3DFMT_UYVY        ,0x0        ,0x0        ,0x0        ,0x0        ,2      ,0      ,0          ,TRUE  },
     {WINED3DFMT_YUY2        ,0x0        ,0x0        ,0x0        ,0x0        ,2      ,0      ,0          ,TRUE  },
-    {WINED3DFMT_YV12        ,0x0        ,0x0        ,0x0        ,0x0        ,1/*?*/ ,0      ,0          ,TRUE  },
+    {WINED3DFMT_YV12        ,0x0        ,0x0        ,0x0        ,0x0        ,2      ,0      ,0          ,TRUE  },
     {WINED3DFMT_DXT1        ,0x0        ,0x0        ,0x0        ,0x0        ,1      ,0      ,0          ,TRUE  },
     {WINED3DFMT_DXT2        ,0x0        ,0x0        ,0x0        ,0x0        ,1      ,0      ,0          ,TRUE  },
     {WINED3DFMT_DXT3        ,0x0        ,0x0        ,0x0        ,0x0        ,1      ,0      ,0          ,TRUE  },
@@ -114,6 +114,8 @@ static const StaticPixelFormatDesc formats[] = {
     {WINED3DFMT_Q16W16V16U16,0x0        ,0x0        ,0x0        ,0x0        ,8      ,0      ,0          ,FALSE },
     /* Vendor-specific formats */
     {WINED3DFMT_ATI2N       ,0x0        ,0x0        ,0x0        ,0x0        ,1      ,0      ,0          ,TRUE  },
+    {WINED3DFMT_NVHU        ,0x0        ,0x0        ,0x0        ,0x0        ,2      ,0      ,0          ,TRUE  },
+    {WINED3DFMT_NVHS        ,0x0        ,0x0        ,0x0        ,0x0        ,2      ,0      ,0          ,TRUE  },
 };
 
 typedef struct {
@@ -528,6 +530,7 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {
     FMT_TO_STR(WINED3DFMT_A2W10V10U10);
     FMT_TO_STR(WINED3DFMT_UYVY);
     FMT_TO_STR(WINED3DFMT_YUY2);
+    FMT_TO_STR(WINED3DFMT_YV12);
     FMT_TO_STR(WINED3DFMT_DXT1);
     FMT_TO_STR(WINED3DFMT_DXT2);
     FMT_TO_STR(WINED3DFMT_DXT3);
@@ -558,6 +561,8 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {
     FMT_TO_STR(WINED3DFMT_A32B32G32R32F);
     FMT_TO_STR(WINED3DFMT_CxV8U8);
     FMT_TO_STR(WINED3DFMT_ATI2N);
+    FMT_TO_STR(WINED3DFMT_NVHU);
+    FMT_TO_STR(WINED3DFMT_NVHS);
 #undef FMT_TO_STR
   default:
     {
diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h
index bf35b9f..5b722e7 100644
--- a/include/wine/wined3d_types.h
+++ b/include/wine/wined3d_types.h
@@ -305,6 +305,8 @@ typedef enum _WINED3DFORMAT {
 
     /* Vendor specific formats */
     WINED3DFMT_ATI2N                =  WINEMAKEFOURCC('A', 'T', 'I', '2'),
+    WINED3DFMT_NVHU                 =  WINEMAKEFOURCC('N', 'V', 'H', 'U'),
+    WINED3DFMT_NVHS                 =  WINEMAKEFOURCC('N', 'V', 'H', 'S'),
 
     WINED3DFMT_FORCE_DWORD          = 0xFFFFFFFF
 } WINED3DFORMAT;




More information about the wine-cvs mailing list